MySQL select entries older than

From D3xt3r01.tk
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Query

SELECT * FROM `table` WHERE `timestampfield` > subdate(NOW(), INTERVAL 10 MINUTE);

OR

SELECT * FROM `table` where `timestampfield` > NOW() - INTERVAL 10 MINUTE;

That would show you all the entries created in the last 10 minutes .. you can replace 'minute' with hour/day/month/year... ofcourse .. you can also replace the number ..

LINKS

MySQL Manual Entry