D
D
dienerie2021-06-24 11:49:09
MySQL
dienerie, 2021-06-24 11:49:09

How sql query to display records in the interval for the last hour but not earlier than half an hour?

Each entry has a registration date.
How to query records for the last hour, but not earlier than 30 minutes from the current time?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Slava Rozhnev, 2021-06-24
@dienerie

SELECT *
FROM tbl
WHERE registration >= DATE_SUB(NOW(), INTERVAL 30 MINUTE)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question