I have a view with a datetime field and I need to eliminate rows that occur within 2 seconds of the first. So for example:
ID AcctID EntryTime
1 1 1/2/2010 10:00:00.000
2 1 1/2/2010 10:30:00.000
3 1 1/2/2010 10:30:00.500 *
4 1 1/2/2010 10:30:01.200 *
5 2 1/2/2010 10:30:01.000
6 2 1/2/2010 11:05:02.500
The (*) rows are the ones in question. I need to filter out ID 3 and 4 because they are within two seconds of ID 2, grouped by AcctID.
I would love to figure this out using set techniques instead of looping or cursors. Any thoughts?
ID AcctID EntryTime
1 1 1/2/2010 10:00:00.000
2 1 1/2/2010 10:30:00.000
3 1 1/2/2010 10:30:00.500 *
4 1 1/2/2010 10:30:01.200 *
5 2 1/2/2010 10:30:01.000
6 2 1/2/2010 11:05:02.500
The (*) rows are the ones in question. I need to filter out ID 3 and 4 because they are within two seconds of ID 2, grouped by AcctID.
I would love to figure this out using set techniques instead of looping or cursors. Any thoughts?