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的主要内容,如果未能解决你的问题,请参考以下文章
You can't specify target table 'table' for update in FROM clause
You can't specify target table 'xxx' for update in FROM clause
mysql You can't specify target table 'xxx' for update in FROM clause的解决
You can't specify target table 't_mail_marketing' for update in FROM clause
You can't specify target table '表名' for update in FROM clause”解决方法
You can't specify target table 'e' for update in FROM clause