You can't specify target table 'Person' for update in FROM clause
Posted tk55
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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的主要内容,如果未能解决你的问题,请参考以下文章