Timestamp difference in Minutes
862489Sep 8 2011 — edited Sep 8 2011I am calculating and hence selecting the difference between the two timestamps in minutes by using the below query.
select (extract(second from intervl) / 60) +
extract(minute from intervl) + extract(hour from intervl) * 60 +
extract(day from intervl) * 60 * 24 DIFF_IN_MINS,mydate
from (select (timestamp2- timestamp1) intervl,maindate mydate
from mytable
where maindate between v_start_date AND v_end_date);
However in certain scenarios, i have the DIFF_IN_MINS value.. I want to retrieve(SELECT) the data from mytable with the DIFF_IN_MINS values
Pls could you suggest as how I can query and retrieve the data when I know the DIFF_IN_MINS value
Many Thanks in advance