What does the alias after DELETE mean?
E.g. I have a query:
DELETE p1
FROM Person p1, Person p2
WHERE p1.Email = p2.Email AND p2.Id < p1.Id
What does it mean DELETE p1?
I understand it as follows. First we find a cartesian product of the Person table with itself. Then we remove all the rows where the Email from the both tables (p1 and p2) is not the same. Then we remove all the rows where the Id from the p2 is greater or equal than the Id from p1. Now we are left with some rows. We pick all the Ids from the p1 part of the left rows and remove all the entries from the initial Person table, which has the Id contained in the picked Ids.
Is my understanding correct?
If it is correct, then DELETE p1 means delete all entries in Person where Id is in the resulting p1 part of the rows.