There is a need to select a subsequence of data from the table, based on the difference between the timestamp of neighboring elements. you need to select such a sequence, the difference between the timestamp elements of which does not exceed 5 minutes
Understand how to choose the difference
select record_timestamp - (select record_timestamp from short_summary as ss2 where (short_summary.record_timestamp - ss2.record_timestamp) / 60 <= 5 limit 1 ) as diff, * from short_summary We get all the elements with a difference of 5 minutes. that is, as many subsequences as there are in the table. But since the sequence needs one, I need an operator similar to LIMIT, which would terminate the sample under a certain condition, for example, if the id is not adjacent.