Hard worker Hard worker - 1 year ago 69
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 Source
DELETE FROM table WHERE date < '2011-09-21 08:21:22';