oralce 時間間隔函數

numtodsinterval(<x>,<c>),x是一個數字,c是一個字符串,

表明x的單位,這個函數把x轉爲interval day to second數據類型
常用的單位有 ('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與numtodsinterval函數類似,將x轉爲interval year to month數據類型
常用的單位有'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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章