Deleting records before a certain date

后端 未结 4 737
暗喜
暗喜 2020-12-13 11:54

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 20

4条回答
  •  不思量自难忘°
    2020-12-13 12:37

    This is another example using defined column/table names.

    DELETE FROM jos_jomres_gdpr_optins WHERE `date_time` < '2020-10-21 08:21:22';
    

提交回复
热议问题