Oracle用rowid删除重复记录

来源:互联网 发布:oracle查询去重复数据 编辑:程序博客网 时间:2024/05/16 03:52
 Oraclerowid删除重复记录

查询:

select *
 from org_dept a
 where a.rowid !=
       (select max(rowid) from org_dept b where a.dept_code = b.dept_code)

 

删除:

delete
 from org_dept a
 where a.rowid !=
       (select max(rowid) from org_dept b where a.dept_code = b.dept_code)

原创粉丝点击