본문 바로가기
Programming/LeetCode

[LeetCode] Duplicate Emails

by 데이터현 2022. 3. 31.

https://leetcode.com/problems/duplicate-emails/

 

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

email이 중복된 id를 출력하면 되는 문제

 

SELECT 
    email AS Email
FROM Person
GROUP BY email
HAVING COUNT(email) > 1
;

GROUP BY + HAVING을 활용하여 간단하게 풀이할 수 있다.

 

댓글