查找表中多余的重复记录,重复记录是根据某个字段来判断
select * from 表名 where 字段 in (select 字段 from 表名 group by 字段 having count(字段) > 1)
删除表中多余的重复记录,重复记录是根据某字段来判断,根据ID保留最小的记录
delete from 表名 where 字段 in (select 字段 from 表名 group by 字段 having count(字段) > 1) and ID not in (select min(ID) from 表名 group by 字段 having count(字段)>1)