Time difference between records

I have a table that has (among others) a timestamp column (named timestamp, this is Oracle's standard DATE data type). Records about 4-11 minutes apart, about 7 or 8 records every hour, and I'm trying to determine if they have any pattern.

Is there an easy way to see each record and the number of minutes that were recorded after the previous record?

Thanks AndyDan

+3
source share
2 answers

This is Oracle 9i + using function

+8
source

If the entries have a sequential identifier, you can do it yourself:

SELECT t2.*, t2.timestamp - t1.timestamp AS timediff
FROM foo t1 inner join foo.t2 on t1.id = t2.id-1

, , , .

+1

Source: https://habr.com/ru/post/1777550/


All Articles