Answer the question
In order to leave comments, you need to log in
How to select rows with a gap in time?
There is a table in which the data is written every minute. Which query can select rows after a certain time interval? At the moment, the task is only to select every hour (0:00, 01:00, 02:00, ... , 23:00), every half hour and every 15 minutes.
Answer the question
In order to leave comments, you need to log in
Or add a field with the time of adding, and make a selection on it.
Or, with each request, save the last new record of the interval somewhere, and use it to navigate which records are new (this option is obviously worse).
SELECT * FROM `table` WHERE TIME(`column`) BETWEEN '21:00:00' AND '22:00:00'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question