How to get the difference in minutes from 2 timestamp columns

oracletimestamp

Can't seem to figure this out. Just need the difference in minutes between 2 oracle timestamp columns.

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

Best Answer

select
  round(
    (cast(current_timestamp as date) - cast(<other_timestamp> as date))
    * 24 * 60
  ) as diff_minutes
from <some_table>;

This is what I used to calculate the difference between the current timestamp and a heart beat table entry for latency monitoring.