mysql删除某张表三个月前的数据

表中需要含有一个时间字段,根据这个字段删除

delete from thk_shop_order where pay_status="0" AND update_date<curdate() - interval 3 month;

注:CURDATE() 函数返回当前的日期。

猜你喜欢

转载自blog.csdn.net/jxyang95/article/details/93462392