You can’t specify target table for update in FROM clause
You can’t specify target table for update in FROM clause
mysql不能在同一表中查询的数据作为同一表的更新数据
mssql和Oracle不会出现此问题
规避:
将select出的结果再通过中间表select一遍
delete from tbl where id in
(
select a.id from
(
select max(id) id from tbl a where EXISTS
(
select 1 from tbl b where a.tac=b.tac group by tac HAVING count(1)>1
)
group by tac
) a
)