查询及删除数据重复记录的方法

方法1、通过rowid 

select * from db.tbfp03 t1 where t1.rowid>
(select min(t2.rowid) from db.tbfp03 t2 where t1.compid = t2.compid and t1.applyno = t2.applyno); 

方法2、通过in及分组函数 

select t1.* from db.tbfp03 t1 where (t1.compid,t1.applyno) in(select t2.compid,t2.applyno from db.tbfp03 t2 
group by t2.compid,t2.applyno having count(*)>1)
原文地址:https://www.cnblogs.com/tianmingt/p/4085626.html