I have a column name called last_activity
that is of type DATETIME. (so. 2021-01-03 00:00:00). I want to find all rows which are within 5 minutes of now. I attempted the following:
SELECT *
FROM users
WHERE last_activity > DATE_SUB(NOW(),INTERVAL 5 MINUTE)
I get 0 rows, even though the activity is within 5 minutes (I know because the database says so). How can I fix this?