numtodsinterval(<數字>,<字元串>) 字元串包含('day','hour','minute','second') select sysdate,sysdate+numtodsinterval(3,'day') as res from dual; --取三天後的時間 select s ...
numtodsinterval(<數字>,<字元串>)
字元串包含('day','hour','minute','second')
select sysdate,sysdate+numtodsinterval(3,'day') as res from dual; --取三天後的時間
select sysdate,sysdate+numtodsinterval(3,'hour') as res from dual;--取三小時後的時間
select sysdate,sysdate+numtodsinterval(3,'minute') as res from dual; --取三分鐘後的時間
select sysdate,sysdate+3/24 as res from dual --取三分鐘後的時間 需換算
select sysdate,sysdate+numtodsinterval(3,'second') as res from dual; --取三秒後的時間
numtodsinterval(<數字>,<字元串>)
字元串包含('year','month')
select sysdate,sysdate+numtoyminterval(3,'year') as res from dual; --取三年後的時間
select sysdate,sysdate+numtoyminterval(-3,'month') as res from dual;--取三月前的時間