How to find difference between 2 timestamps in seconds?
Is there any system function or I should manually calculate some second like this
SELECT t1_id,
EXTRACT(Day FROM(mod_date_time – create_date_time) DAY TO SECOND) as Day,
EXTRACT(HOUR FROM(mod_date_time – create_date_time) DAY TO SECOND) as Hour,
EXTRACT(Minute FROM(mod_date_time – create_date_time) DAY TO SECOND) as Minute,
EXTRACT(SECOND FROM(mod_date_time – create_date_time) DAY TO SECOND) as second
FROM t1;
In Oracle, dates are just numbers. Each day is 1 integer. Finding the seconds difference can be done as follows: