把時間戳之差轉換成時分秒格式

xsb發表於2010-07-06
WITH a AS
(SELECT to_timestamp('2010-7-7 11:11:11', 'yyyy-mm-dd hh24:mi:ss') - to_timestamp('2010-7-5 12:12:12', 'yyyy-mm-dd hh24:mi:ss') inter
FROM dual)
SELECT inter, extract(DAY FROM inter), extract(hour FROM inter), extract(minute FROM inter), extract(SECOND FROM inter) FROM a;
其他參考:
http://xsb.itpub.net/post/419/52334[@more@]

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

相關文章