융무의 기술블로그
article thumbnail

 

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;
profile

융무의 기술블로그

@융무

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!