SQL which removes entries with duplicate emails DELETE
FROM Person
WHERE Id IN (
 SELECT Id
 FROM Person
 GROUP BY Email
 HAVING COUNT(*) &gt; 1 AND Id &lt;&gt; MIN(Id)
)

The above query produces the error:
You can't specify target table 'Person' for update in FROM clause

Why?
I am just trying to solve this problem to improve my SQL skills.
I checked the above SQL query here and it seems my syntax is fine.
Use multiple-table DELETE syntax:
DELETE t1.*
FROM Person t1
JOIN Person t2 USING (Email)
WHERE t1.id &gt; t2.id