I have a table with two columns, location and timestamp in mssql 2000
I am looking to have a query that returns any location that has 3 or more timestamps within a 3 hour period. It would be 1 column of results just listing locations that fit that criteria
For example location a has events today at 1 am 2 am 2:30 am and 5 am so location a would show up in the result set. 3 events in a 3 hour time period.
Location b would have 1 am 6 am 6:30 6:45 am and 12 am. Since it had 3 timestamps within a 3 hr period, it counts
location c has events at 1 am 5 am 10 am and 6 pm, but we do not have 3 events within a 3 hour time period, so it does not return in the results.
I am looking for a query to do this filter.
where (3 events occur within a 3 hour time frame)