1 delete与in搭配使用,效率特别低,如下可解决该问题,not in同理
/*正常写法*/
DELETE from activity where id in ( SELECT id from activity_data);
/*优化后写法*/
DELETE from activity where id in (select * from (SELECT id from activity_data) t);
原文地址:https://www.cnblogs.com/cdut-yy/p/12048130.html
时间: 2024-10-07 10:33:05