Home > Database > Mysql Tutorial > body text

oracle去除重复数据sql

WBOY
Release: 2016-06-07 14:54:28
Original
1643 people have browsed it

在oracle中,有些数据完全一样,要清除掉重复的,只保留一条不重复的数据。 谢谢 柳下惠 提供的第二个去重sql。 这个可能速度更快些。 Oracle delete table1 where rowid not in (select max(rowid) from table1 group by col1 ,col2 ) DELETE table sWHERE r

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

谢谢  柳下惠  提供的第二个去重sql。 这个可能速度更快些。
Oracle
delete table1 where rowid not in (
select max(rowid) from table1 group by col1 ,col2  )
Copy after login
DELETE table s
WHERE rowid < (SELECT MAX(rowid) FROM table q WHERE q.name = s.name)
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!