MySQL selects records 1 hour ago or more recent in the datetime column

Hi I need help querying a MySQL database.

Where can I use where to record records that were an hour ago or more recent using a timestamp DATETIME?

+3
source share
1 answer

Something like that? I assume that DATETIME timestampis the DATETIME field.

SELECT * FROM table WHERE datetimefield >= DATE_SUB(NOW(), INTERVAL 1 HOUR)

For more information, check the MySQL date and time functions .

+11
source

All Articles