建表
Create table If Not Exists Person (Id int,Email varchar(255));
Truncate table Person;
insert into Person (Id, Email) values ('1','[email protected]');
insert into Person (Id, Email) values ('2','[email protected]');
insert into Person (Id, Email) values ('3','[email protected]');
根据邮箱分组统计,个数大于1
select Email, count(1)
from person
GROUP BY Email
HAVING count(1) > 1