I have a table with consecutive timestamps:
2011-03-17 10:31:19
2011-03-17 10:45:49
2011-03-17 10:47:49 ...
I need to find the average time difference between each of them (maybe tens) in seconds or something simple, I can work with him from there. So, for example, the indicated time between arrivals only for the first two times would be 870 (14 m 30 s). For all three times, this would be: (870 + 120) / 2 = 445 (7 m 25 s).
Note, I am using postgreSQL 8.1.22.
EDIT: the table I mentioned above refers to another query, which is literally just one columnar list of timestamps
source
share