DELETE FROM Persons WHERE Id NOT IN (SELECT MIN(Id)AS id FROM Persons GROUP BY Email) ; You can't specify target table 'Person' for update in FROM cla ...
DELETE FROM Persons WHERE Id NOT IN (SELECT MIN(Id)AS id FROM Persons GROUP BY Email) ;
You can't specify target table 'Person' for update in FROM clause
問題出現:同一個表裡刪除操作 和查詢連同一起了
把後半句
(SELECT MIN(Id)AS id FROM Persons GROUP BY Email)
改
(select * from (SELECT MIN(Id)AS id FROM Persons GROUP BY Email)temp )