oracle删除表中重复记录(只保留最新的一条记录)

使用如下语句进行删除

DELETE FROM USER where ID in   (select ID from USER group by ID having count(*) > 1)
and rowid not in (select min(rowid) from USER group by ID having count(*)>1)

 


版权声明:本文为sunxiaoju原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。