查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断
select * from people
where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)
例如:
select * from testtable
where numeber in (select number from people group by number having count(number) > 1 )
可以查出testtable表中number相同的记录
例如:
产品参数表rule_product_info 同一个申请单是否有多条记录
用select app_no,count(1) from rule_product_info group by app_no having count(1)>1
2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录
delete from people