Hard worker Hard worker - 2 months ago 6
MySQL Question

Deleting records before a certain date

How would I go about deleting all records from a MySQL table from before a certain date, where the date column is in DATETIME format?

An example datetime is

2011-09-21 08:21:22
.

Thanks.

Answer
DELETE FROM table WHERE date < '2011-09-21 08:21:22';