delete dup email
leetcode
https://leetcode.com/problems/delete-duplicate-emails/
DELETE P2 FROM Person (as) P1, Person (as) P2 WHERE P1.Email = P2.Email AND P1.Id < P2.Id;
sql
FROM Person (as) P1, Person (as) P2 is an implicit join same as an inner join; as can be ignored
REF:
- https://github.com/int32bit/leetcode/tree/master/database/DeleteDuplicateEmails
- http://yanhuqing666.github.io/leet-code-database-easy
- http://stackoverflow.com/questions/5118562/inner-join-vs-multiple-table-names-in-from
- group_by is precedent than select, so the result is group_by email first and then select the min ID from each group