I have a datetime column in my database that stores results as:
2011-08-16 14:00:23
I want to do a select statement from this table to find all the records that have been added in the last 5 minutes.
Any ideas?
I have a datetime column in my database that stores results as:
2011-08-16 14:00:23
I want to do a select statement from this table to find all the records that have been added in the last 5 minutes.
Any ideas?
use BETWEEN and put the earlier value first
WHERE datetimeadded
BETWEEN CURRENT_TIMESTAMP - INTERVAL 5 MINUTE
AND CURRENT_TIMESTAMP