calculate time from 2 timestamp column
Hi,
From a table I need to calculate the total time taken by one process.
How can I get the required output in one sql and required format.
any help will be appreciated.
SQL> desc batch_info
Name Null? Type
----------------------------------------------------------------------- -------- ------------------------------------------------
BATCH_ID NOT NULL NUMBER
BATCH_APP_INFO VARCHAR2(50)
BATCH_DTTM TIMESTAMP(6)
START_DTTM TIMESTAMP(6)
END_DTTM TIMESTAMP(6)
BATCH_STATUS VARCHAR2(20)
the format should be
--------------------------------------------------------------
starting time 29-Dec-14 03:00:25
ending time 29-Dec-14 05:33:20
Total time taken 2 hrs 32 min
so far I'm able to frame like this .....
================================
Select 'Starting Time :'|| to_char(start_dttm,'DD-Mon-YY HH:MI:SS') st,