Tuesday, April 6, 2010

Delete MySQL Records Older Than *BLAH*

DELETE FROM tableName WHERE columnName < DATE_SUB(NOW(), INTERVAL 14 DAY);

DAY
WEEK
MONTH

etc.

Thanks to:
http://benperove.com/

No comments:

Post a Comment