2016-02-26 117 views

回答

0

如果您duedatedate datatype然后用trunc

select * 
from tax 
where trunc(sysdate) - trunc(duedate) = 3 
1

3天远离你可以尝试这样的:

select * from tax where trunc(sysdate) - to_date(myDate, 'yyyy-mm-dd') = 3 
+0

'Extract'不起作用。 – dnoeth

+0

@dnoeth: - 删除了! –

0

取而代之的应用演算(并且使索引无法使用),您最好一次执行此操作:

select * from tax 
where myDate >= trunc(sysdate) + 3 
    and myDate < trunc(sysdate) + 4