I’ve datasets in a table with a timestamp value and an event string. How can I get all events that are min. 5 seconds apart of other events with the same event value.
Data given:
TS EVENT
-------------------------- --------------------------------
2012-03-15 13:09:27.486000 foo
2012-03-15 13:09:37.253000 bar
2012-03-15 13:09:31.243000 foo
2012-03-15 13:09:26.243000 foo
2012-03-15 13:09:47.841000 foo
The result should be
TS EVENT
-------------------------- --------------------------------
2012-03-15 13:09:26.243000 foo
2012-03-15 13:09:37.253000 bar
2012-03-15 13:09:47.841000 foo
Two of the “foo” events are only 3 or 4 seconds before or after another “foo” event and should therefore not be selected. If multiple event exists in a certain range of seconds, only the first one should be returned.
Any hint appreciated! Thanks!
Try: