I have a data set that has a timestamp column. What I’m looking for is a select statement that will allow me to collect a result set that contains rows from every x seconds. For example, consider this table:
bob 05-05-2024 15:00
Ted 05-05-2024 15:06
Alice 05-05-2024 15:07
John 05-05-2024 15:08
Denver 05-05-2024 15:11
Then the result of the query if x is 5 would be:
bob 05-05-2024 15:00
bob 05-05-2024 15:00
John 05-05-2024 15:08
Denver 05-05-2024 15:11
The first row represents the start time. The second row represents the time start+5 secs. The third row is start+10, the 4th is start+15.
I could add another column that has the “chunk” time so that the result set would be the latest of all records of chunk time. That could work for x=5 but not for other values. I could also keep a timer while writing and just write the index of the last record written every 5 seconds.