oracle查询表内的重复数据,并删除重复数据

来源:互联网 发布:最新彩票预测软件 编辑:程序博客网 时间:2024/06/08 18:47
---查询重复数据:select *     from user_tab u      where u.aa003 in (select u.aa003         from user_tab u           group by u.aa003   having count(*) > 1)----删除重复数据:delete from user_tab   where aa003 in (select aa003 from     user_tab group by aa003 having count(aa003) > 1)       and rowid not in (select min(rowid) from         user_tab group by aa003 having count(aa003 )>1) 


 

0 0