I never remember how to do this properly - can you help me fix this query?
SELECT * from log where now() - EventTime < '1 day'
Note - this question seems identical but there's no solution there for mysql.
I never remember how to do this properly - can you help me fix this query?
SELECT * from log where now() - EventTime < '1 day'
Note - this question seems identical but there's no solution there for mysql.
SELECT * FROM log WHERE SUBDATE(NOW(), 1) < EventTime
Or to only select the ones from today:
SELECT * FROM log WHERE DATE(NOW()) = DATE(EventTime)
SELECT * FROM log WHERE EventTime >= DATE_SUB(CURDATE(), INTERVAL 1 DAY);