解法(1):思路为先查询出查询出重复的ID并且取最小值
select min(Id) Id,Email from Person group by Email
或者
Select min(Id) as Id,distinct Email from Person
然后删除不在ID为此里面的值
delete from Person where Id not in(select Id from ( select min(Id) Id,Email from Person group by Email)t)
解法(2):使用 查询出Email相等ID不是最小的
select B.Id as Id from Person as A,Person as B where A.Id<B.Id and A.Email=B.Email
然后删除查询出来的结果
delete from Person where Id in(select Id from(select B.Id as Id from Person as A,Person as B where A.Id<B.Id and A.Email=B.Email) t)