如何在oracle中找到时间戳之间的差异?
问题描述:
我必须找到这两个时间戳之间的区别,请帮助我
I have to find the difference between these two timestamps please help me
27-FEB-12 02.11.31.910000000 AM, 27-FEB-12 02.11.49.002000000 AM
答
减去它们.结果将是INTERVAL
数据类型,在这种情况下为17.092秒.
Subtract them. The result will be an INTERVAL
data type representing, in this case, 17.092 seconds.
SQL> ed
Wrote file afiedt.buf
1 select to_timestamp( '27-FEB-12 02.11.31.910000000 AM', 'DD-MON-RR HH.MI.SS.FF9 AM') -
2 to_timestamp( '27-FEB-12 02.11.49.002000000 AM', 'DD-MON-RR HH.MI.SS.FF9 AM')
3* from dual
SQL> /
TO_TIMESTAMP('27-FEB-1202.11.31.910000000AM','DD-MON-RRHH.MI.SS.FF9AM')-TO_
---------------------------------------------------------------------------
-000000000 00:00:17.092000000