How to select all records that are 10 minutes within current timestamp in MySQL?

I have timestamps in a table column called “created_ts” like so:

2020-09-11 00:40:35

How can I get all records where the timestamp is within 10 minutes of the current timestamp (in the most efficient way)?

Asked on September 10, 2020 in Mysql.
Add Comment
1 Answer(s)
SELECT * FROM myTable
WHERE created_ts >= NOW() - INTERVAL 10 MINUTE
Answered on September 10, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.