mysql中不能查自己同时更新自己,需要把子查询的查询结果用个临时表装
报错sql语句:
delete from tb_task_detail where main_id in (select main_id from tb_task_detail where id = 5 )
修改后sql语句
delete from tb_task_detail where main_id in (select * from (select main_id from tb_task_detail where id = 5 )a)