Duplicate Emails
2018-04-26 本文已影响0人
阿发贝塔伽马
group by后,记录id 最大值最小值,两个最值不一样就是重复邮箱
select email from ((select min(id) as minid,max(id) as maxid, email
from person group by email) as newPerson) where minid != maxid
#select Email from Person group by Email having count(*)>1;
#select sum(id/id) email from person group by email
# 利用count(*)计数
select email from person group by email having count(*)>1