I have a table of data recording certain user events. The results looks something like:
ID Username EventDate
1 UserA 2010-10-21 16:59:59.367
2 UserA 2010-10-21 17:00:00.114
3 UserA 2010-10-21 17:00:00.003
4 UserA 2010-10-21 17:00:02.867
5 UserB 2010-10-21 18:43:26.538
6 UserB 2010-10-21 18:47:33.373
I want to run a query that removes all events that occur within 3000 milliseconds of a previous event. Note that milliseconds are relevant.
The resulting table would look like:
ID Username EventDate
1 UserA 2010-10-21 16:59:59.367
4 UserA 2010-10-21 17:00:02.867
5 UserB 2010-10-21 18:43:26.538
6 UserB 2010-10-21 18:47:33.373
How can I do this?