SELECT * from new WHERE date < DATE_ADD(now(),interval -1 day);
To get records from the last 24 hours:
SELECT * from [table_name] WHERE date > (NOW() - INTERVAL 24 HOUR)
SELECT * FROM news WHERE date > DATEADD(d,-1,GETDATE())
SELECT * FROM news WHERE date > DATE_SUB(NOW(), INTERVAL 24 HOUR)
SELECT * FROM news WHERE date < DATEADD(Day, -1, date)
There are so many ways to do this. The listed ones work great, but here's another way if you have a datetime field:
SELECT [fields]
FROM [table]
WHERE timediff(now(), my_datetime_field) < '24:00:00'
timediff()
returns a time object, so don't make the mistake of comparing it to 86400 (number of seconds in a day), or your output will be all kinds of wrong.
You simply select dates that are higher than the current time minus 1 day.
SELECT * FROM news WHERE date >= now() - INTERVAL 1 DAY;
Source: Stackoverflow.com