PLSQL 查重

1、列出某个字段重复的所有行:

select * from table where lID in (select lID from table group by lID having count(lID) > 1);

2、删除重复数据,留rowid最小的行:

delete from table where lid in (select lid from table group by lid   having count(lid) > 1) and rowid not in (select min(rowid) from  table group by lid having count(lid)>1)

3、查询名称重复:

Select Name,Count(*) From A Group By Name Having Count(*) > 1

posted @ 2016-04-22 18:09  susiee  阅读(796)  评论(0编辑  收藏  举报