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 )

 

posted on 2020-07-01 15:13  Honey_Badger  阅读(28)  评论(0编辑  收藏

导航

ゅ≈❤≈ゅ