leetCode/sql/查找重复的电子邮箱.sql

26 lines
412 B
MySQL
Raw Normal View History

2020-11-21 13:03:04 +00:00
/**
2020-02-23 14:02:58 +00:00
SQL Person
```
+----+---------+
| Id | Email |
+----+---------+
| 1 | a@b.com |
| 2 | c@d.com |
| 3 | a@b.com |
+----+---------+
```
```
+---------+
| Email |
+---------+
| a@b.com |
+---------+
```
2020-11-21 13:03:04 +00:00
**/
2020-02-23 14:02:58 +00:00
select Email from Person group by Email having count(*) > 1
2020-11-21 13:03:04 +00:00