2016-02-26 118 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