numtodsinterval、numtoyminterval

Oracle计算时间函数(numtodsinterval、numtoyminterval)

numtodsinterval(<x>,<c>) ,x是一个数字,c是一个字符串
常用的单位有 ('day','hour','minute','second')
example
SQL> select sysdate,sysdate+numtodsinterval(3,'hour') as res from dual;
SYSDATE RES
------------------- -------------------
2007-09-05 01:45:34 2007-09-05 04:45:34


numtoyminterval(<x>,<c>) ,x是一个数字,c是一个字符串
常用的单位有('year','month')
example
SQL> select sysdate,sysdate+numtoyminterval(3,'year') as res from dual;
SYSDATE RES
------------------- -------------------
2007-09-05 01:54:53 2010-09-05 01:54:53

posted @ 2020-08-06 14:36  小窝蜗  阅读(104)  评论(0编辑  收藏  举报