At 10:55, 19990819, "Martin Lilienthal"<webmaster@stripped> wrote:
>Is there a way to select all rows which are inserted 1 or more hours ago?
>
>A table called test has these cols:
>
>col1 varchar(20),
>col2 int,
>col3 TIMESTAMP
mysql> select * from test;
+------+------+----------------+
| col1 | col2 | col3 |
+------+------+----------------+
| a | 1 | 19990819113000 |
| b | 2 | 19990819103000 |
| c | 3 | 19990819104000 |
+------+------+----------------+
3 rows in set (0.00 sec)
mysql> select NOW(), test.* from test
-> where col3 < date_sub(now(), interval 1 hour);
+---------------------+------+------+----------------+
| NOW() | col1 | col2 | col3 |
+---------------------+------+------+----------------+
| 1999-08-19 11:35:59 | b | 2 | 19990819103000 |
+---------------------+------+------+----------------+
1 row in set (0.00 sec)
Tim