Algorithm/SQL
[SQL][Leetcode] 182. Duplicate Emails
융무
2020. 6. 21. 19:20
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
Problem
Analysis
1. 중복된 이메일 주소를 찾기위해서 먼저 Email 주소를 GROUP BY 해준다.
2.HAVING을 이용하여 개수가 1개 초과인것을 찾는다.
Solution
SELECT Email
FROM Person
GROUP BY Email
HAVING COUNT(*) >1;