182. duplicate emails

SQL Schema

Write a SQL query to find all duplicate emails in a table named Person.

1
2
3
4
5
6
7
+----+---------+
| Id | Email |
+----+---------+
| 1 | [email protected] |
| 2 | [email protected] |
| 3 | [email protected] |
+----+---------+

For example, your query should return the following for the above table:

1
2
3
4
5
+---------+
| Email |
+---------+
| [email protected] |
+---------+
1
2
# Write your MySQL query statement below
select Email from Person group by Email having (Email) > 1