#120. [LeetCode / MySQL] 196. Delete Duplicate Emails

문제

 

 

입력 코드

DELETE p1
FROM person AS p1, person AS p2
WHERE p1.email = p2.email AND p1.id > p2.id
DELETE p1
FROM person AS p1
JOIN person AS p2
ON p1.email = p2.email
WHERE p1.email = p2.email AND p1.id > p2.id

 

 

코드 설명

#DELETE #JOIN #ON #WHERE 

 

 

문제 출처

https://leetcode.com/problems/delete-duplicate-emails/description/?envType=study-plan-v2&envId=top-sql-50