However, if I change the code to this:
DELETE FROM Person
WHERE Id IN
(SELECT a.Id FROM Person AS a
JOIN Person AS b
ON a.Email=b.Email AND a.Id>b.Id) ;'''
It doesn't work.
Could anyone tell me why I have to use another SELECT to refer my subquery AS p?