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

方法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)

 

posted on 2014-11-09 17:53  相约future  阅读(259)  评论(0编辑  收藏  举报