Post

leetcode(리트코드)-182 Duplicate Emails(SQL)

leetcode 182 - Duplicate Emails 문제입니다.

1. 문제

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


2. Input , Output


3. 분류 및 난이도

Eazy 난이도 문제입니다.


4. 문제 해석

  • 중복되는 Email을 찾아서 리턴합니다.

5. code

코드설명

MYSQL

1
2
3
4
5
6
7
8
9
10
11
12
select Email
from Person
group by Email
having count(*) > 1
/*
-- 내가 작성한 것.
SELECT distinct p.Email 
FROM Person p, Person p2
WHERE p.Id <> p2.Id and p.Email = p2.Email 
*/
      
            

6. 결과 및 후기, 개선점

필요시 c++로 짜드리겠습니다.

This post is licensed under CC BY 4.0 by the author.