如何从2个时间戳列中获得分钟差异?

时间:2013-11-25 20:48:37

标签: oracle timestamp

似乎无法弄清楚这一点。只需要2个oracle时间戳列之间的分钟差异。

END_TS                                  START_TS
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
11-NOV-13 01.52.14.000000 PM                            11-NOV-13 01.51.14.000000 PM
11-NOV-13 02.20.47.000000 PM                            11-NOV-13 02.19.47.000000 PM
18-NOV-13 12.44.54.000000 PM                            18-NOV-13 12.34.02.000000 PM
22-NOV-13 12.02.09.000000 AM                            22-NOV-13 12.02.08.000000 AM

2 个答案:

答案 0 :(得分:0)

SELECT ROUND( (END_TS - START_TS) * 24 * 60, 0) DifferenceInMinutes 
FROM YourTable

答案 1 :(得分:0)

SELECT ( CAST(END_TS AS DATE) - CAST(START_TS AS DATE)) * 24 * 60 from dual

并在需要时将其围绕