I want to query a database in such a manner where all rows which comes in the given time are fetched. My DB table has a Date column which holds data like this
2012-04-23 08:39:10
2012-04-23 08:41:37
2012-04-23 13:49:56
i want to get all rows that contain the time like 5 min before. Actually what i am trying here is to show all users that were online 5 min before. These dates and times are created with their last activity. Any help will be very much appreciated.
Date> SUBDATE(NOW(), INTERVAL '5' MINUTE)) but obviously it didn't worked...:(SUBDATE(NOW(), INTERVAL '5' MINUTE),DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 5 MINUTE),subtime(now(),'00:05:00')=in your SQL or try usingBETWEEN.