You can't specify target table 'Person' for update in FROM clause

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 )

 

你可能感兴趣的:(You can't specify target table 'Person' for update in FROM clause)