timestamp型別的加減運算

wenzai169發表於2012-01-04

SELECT to_char(fapplytime + NUMTODSINTERVAL(3,'day'),'yyyy-mm-dd HH24:mi:ss:ff6'), fapplytime FROM tdeposit where id=376169319;

 對numtodesignterval的原版詮釋如下:
  NUMTODSINTERVAL converts n to an INTERVAL DAY TO SECOND literal. The argument n can be any NUMBER value or an expression that can be implicitly converted to a NUMBER value. The argument interval_unit can be of CHAR, VARCHAR2, NCHAR, or NVARCHAR2 datatype. The value for interval_unit specifies the unit of n and must resolve to one of the following string values:
  ’DAY’
  ’HOUR’
  ’MINUTE’
  ’SECOND’

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/181228/viewspace-1057031/,如需轉載,請註明出處,否則將追究法律責任。

相關文章