서브쿼리

    LeetCode Delete Duplicate Emails [ MySQL ]

    Delete Duplicate Emails - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 서브쿼리 DELETE FROM person WHERE id NOT IN ( SELECT id FROM ( SELECT email, MIN(id) as id FROM person GROUP BY 1 ) temp ) 조인 DELETE p1 FROM person p1 INNER JOIN person p2 on p1.email = p2.email WHERE p1.id > p2.id