oracle duration between timestamps

Solutions on MaxInterview for oracle duration between timestamps by the best coders in the world

showing results for - "oracle duration between timestamps"
Maddy
12 Aug 2017
1-- Duration between 2 timestamps
2SELECT (extract(DAY FROM TIME2 - TIME1) * 24 * 60 * 60) 
3           + (extract(HOUR FROM TIME2 - TIME1) * 60 * 60) 
4           + (extract(MINUTE FROM TIME2 - TIME1) * 60) 
5           + extract(SECOND FROM TIME2 - TIME1)
6FROM DUAL;