SQL Query to only exclude data of last 24 hours?
datetime, mysql
Solution
Unix timestamp is in seconds. This works with MySQL:
SELECT * FROM NODE WHERE Date < (UNIX_TIMESTAMP(NOW()) - 24*60*60)
Problem
I have the following data: ``` Table Name: NODE NID | Name | Date 001 | One | 1252587739 ``` Date is a unix timestamp. I need a query, whereby I can select only the nodes who's "Date" is older than 24 hours. Something like this: ``` SELECT * FROM NODE WHERE Date < NOW() - SOMETHING ``` - Anybody know how to do this? - Does the NOW() - SOMETHING part take into account that the date is stored as a unix timestamp?