Sunday, 18 August 2013

SQL - grouping the data rows by near time

SQL - grouping the data rows by near time

Here is the problem I am facing: I got a large table containing rows, I
want to group them by near time, more specifically the time difference
less than 2 minutes, example as following With following input data:
A 16:01:01
B 16:01:20
C 16:14:02
D 16:15:01
E 16:20:02
the expected result is
16:01:01 2
16:14:02 2
16:20:02 1
Any idea?

No comments:

Post a Comment