Answer the question
In order to leave comments, you need to log in
How to display records no earlier than half an hour and no later than an hour in sql?
There is a date field when the entry was created.
Need to pick.
How to withdraw lately I understand, interval or stamp.
And how not to do it before half an hour? And no later than an hour.
That is, a record that is 26 minutes old should not be displayed in the request, but if it is already more than 30, then it is necessary. If the recording is more than an hour, then it is not necessary.
Answer the question
In order to leave comments, you need to log in
WHERE created_at BETWEEN CURRENT_TIMESTAMP - INTERVAL 1 HOUR
AND CURRENT_TIMESTAMP - INTERVAL 30 MINUTE
just write the function if , else and set through the signs indicating less than more ">" "<" ">=" "<=" and that's it :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question