delete from A WHERE A.name in (SELECT name FROM B WHERE TIMESTAMPDIFF(DAY,time,NOW()) >= 30);//B表中插入数据与现在时间相比超过三十天的,,删除A表中对应的数据
delete from C WHERE C.task_name in (SELECT name FROM B WHERE TIMESTAMPDIFF(DAY,time,NOW()) >= 30);//B表中插入数据与现在时间相比超过三十天的,,删除C表中对应的数据
delete from B where TIMESTAMPDIFF(DAY,time,NOW()) >= 30);
mysql 多表联合删除
最新推荐文章于 2024-08-25 09:03:53 发布