Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

oracle duration between timestamps

-- Duration between 2 timestamps
SELECT (extract(DAY FROM TIME2 - TIME1) * 24 * 60 * 60) 
           + (extract(HOUR FROM TIME2 - TIME1) * 60 * 60) 
           + (extract(MINUTE FROM TIME2 - TIME1) * 60) 
           + extract(SECOND FROM TIME2 - TIME1)
FROM DUAL;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #oracle #duration #timestamps
ADD COMMENT
Topic
Name
3+8 =