首页 > 数据库技术 > 详细

Oracle 删除重复行

时间:2016-03-27 19:30:07      阅读:228      评论:0      收藏:0      [点我收藏+]

solution 1

create table newtable as select distinct * from oldtable;

drop table oldtable;

rename table newtable to oldtable;

 

solution 2

create table newtable as select distinct * from oldtable;

truncate table oldtable;

alter table oldtable disable all triggers;

insert into oldtable select * from newtable;

commit;

alter table oldtable enable all triggers;

 

solution 3

delete from table a where a.rowid<(select max(rowid) from table b where a.id= b.id);

Oracle 删除重复行

原文:http://www.cnblogs.com/quanweiru/p/5326306.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!