How can I delete all the rows before a certain year(say 2012) in MySQL, where the date column is in DATETIME format? ex:
DELETE FROM table_name WHERE date<2012;
Is not working.
You can do it this way:
DELETE FROM tablename WHERE date < '2012-01-01 00:00:00';
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments