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 )
--------------------------------------------------------------------------------------------------------------------------------------------
作者:Honey_Badger —— 觉得这文章好,点一下左下角
出处:http://tk55.cnblogs.com/
posted on 2020-07-01 15:13 Honey_Badger 阅读(503) 评论(0) 编辑 收藏 举报