Consider a table which holds records with start
and end
timestamps. Can anyone propose an SQL statement which counts the number of seconds of the union of all of the time intervals (from start
to end
) within the table? Just a heads up: time intervals might have overlaps!
Asked
Active
Viewed 105 times
0

Mehran
- 15,593
- 27
- 122
- 221
-
2See http://stackoverflow.com/questions/8451925/merging-intervals-in-one-pass-in-sql – onon15 Nov 11 '12 at 10:09
-
I should have found that myself and I don't know how did I miss that. Thanks anyway. – Mehran Nov 11 '12 at 11:35