思路:
两种思路,可以给当成两个表也可以给当成一张表来做
group by就是按照某个属性给表分个组
way 1:
select a.Email from Person as a,Person as b where a.Id <> b.Id and a.Email = b.Email
way 2:
select Email from Person group by Email having count(*) > 1
时间: 2024-11-07 11:48:55
两种思路,可以给当成两个表也可以给当成一张表来做
group by就是按照某个属性给表分个组
select a.Email from Person as a,Person as b where a.Id <> b.Id and a.Email = b.Email
way 2:
select Email from Person group by Email having count(*) > 1