some1 here Asked: 2021-03-29 10:21:10 +0800 CST2021-03-29 10:21:10 +0800 CST 2021-03-29 10:21:10 +0800 CST SQL 删除包含重复电子邮件的条目 772 DELETE FROM Person WHERE Id IN ( SELECT Id FROM Person GROUP BY Email HAVING COUNT(*) > 1 AND Id <> MIN(Id) ) 上面的查询产生错误: You can't specify target table 'Person' for update in FROM clause 为什么? 我只是想解决这个问题来提高我的 SQL 技能。 我在这里检查了上面的 SQL 查询,看来我的语法很好。 mysql delete 1 个回答 Voted Best Answer Akina 2021-03-29T11:43:18+08:002021-03-29T11:43:18+08:00 使用多表DELETE语法: DELETE t1.* FROM Person t1 JOIN Person t2 USING (Email) WHERE t1.id > t2.id
使用多表DELETE语法: