MySQL selecting records more than 1 hour old
Posted: Fri Aug 07, 2009 11:34 pm
Hello ,
I am trying to run a query that fetches me the records which are more than 1 hour old. For this i have created a field in the table with DATE TIME type.
Here is the table definition
I am running this query to fetch the records which are more than 1 hour old
The problem is sometimes it fetches 3 rows.. and the very next moment it shows none.. Can any one please guide me through this query..
Thanks in advance
I am trying to run a query that fetches me the records which are more than 1 hour old. For this i have created a field in the table with DATE TIME type.
Here is the table definition
Code: Select all
Field Type
slno bigint(20)[index]
tf_devid varchar(50)
tf_audio_port bigint(20)
tf_video_port bigint(20)
tf_insertion_time datetime
tf_updated_time datetime
Code: Select all
SELECT TIME_TO_SEC(NOW()-tf_updated_time) , `tf_sdp_filename` FROM tbl_sdp_users WHERE TIME_TO_SEC(NOW()-tf_updated_time)>3600
Thanks in advance