当前位置: > 数据库 > Oracle >

oracle去除重复数据sql

时间:2016-05-26 14:02来源:linux.it.net.cn 作者:IT

在oracle中,有些数据完全一样,要清除掉重复的,只保留一条不重复的数据。


第二个去重sql。 这个可能速度更快些。 
 

delete table1 where rowid not in (
select max(rowid) from table1 group by col1 ,col2 )
DELETE table s
WHERE rowid < (SELECT MAX(rowid) FROM table q WHERE q.name = s.name)




(责任编辑:IT)
------分隔线----------------------------