您的位置:首页 > 数据库 > Oracle

Oracle用rowid删除重复记录

2008-10-23 09:18 381 查看
Oracle用rowid删除重复记录
查询:

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)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: