我在計算在一個作業的開始和結束時間之間花了多少時間。這裏是我的查詢:在oracle中減去兩個日期sql
SELECT request_id, user_concurrent_program_name,
DECODE(phase_code,'C','Completed',phase_code) phase_code,
DECODE(status_code,'D', 'Cancelled' ,
'E', 'Error' , 'G', 'Warning',
'H','On Hold' , 'T', 'Terminating',
'M', 'No Manager' , 'X', 'Terminated',
'C', 'Normal', status_code) status_code,
actual_start_date, actual_completion_date, completion_text
FROM apps.fnd_conc_req_summary_v
WHERE phase_code='C' AND
status_code='C'
ORDER BY 6 DESC
actual_start_date
和actual_completion_date
的類型是DATE
,格式爲象下面這樣:
ACTUAL_START_DATE ACTUAL_COMPLETION_DATE
3/25/2014 2:00:14 PM 3/25/2014 2:00:18 PM
的問題是,我怎麼能減去這兩列,並得到類似00:00:04
?
在某些情況下,工作可以拼命地跑了兩天,我應該像2 days and 00:00:02
[點擊這裏](http://stackoverflow.com/quest離子/ 15755714/oracle-query-the-difference-between-dates) – Himanshu