https://leetcode.com/problems/duplicate-emails/
Problem
Analysis
1. 중복된 이메일 주소를 찾기위해서 먼저 Email 주소를 GROUP BY 해준다.
2.HAVING을 이용하여 개수가 1개 초과인것을 찾는다.
Solution
SELECT Email
FROM Person
GROUP BY Email
HAVING COUNT(*) >1;
'Algorithm > SQL' 카테고리의 다른 글
[SQL][Leetcode] 184. Department Highest Salary (0) | 2020.06.21 |
---|---|
[SQL][Leetcode] 183. Customers Who Never Order (0) | 2020.06.21 |
[SQL][Leetcode] 181. Employees Earning More Than Their Managers (0) | 2020.06.21 |
[SQL][Leetcode] 177. Nth Highest Salary (0) | 2020.06.19 |
[SQL][Leetcode] 176. Second Highest Salary (0) | 2020.06.19 |