Q:

Mysql: Get all records which are insert before certain hour

I need a query from which I get rows from a table which are insert before a certain hours. 
Let say 1 hour. I need all records from the table which insert before 1 hour. 
I have "createdon" column in table.
For example, I have a table foo, columns are as follows:

ID
Name
Created_on (with timestamp set as default)

There is some records, as follows:
First Record
 - 1
 - A
 - 2013-07-19 04:12:00
Second Record
 - 2
 - B
 - 2013-07-19 02:00:00
If current time is 5:00 pm, then query should return second record only. not first record because it is created with in a hour.

A:

The correct query for this is as follows:
select *
from table_name 
where created_on < date_sub(NOW(), interval 1 hour);
Thank You all for your great help.

