求删除Oracle中重复记录的SQL语句除了UUID不同之外,其余字段都相同,只保留一条,删除其他的SQL语句怎么写呀
求删除Oracle中重复记录的SQL语句
除了UUID不同之外,其余字段都相同,只保留一条,删除其他的 SQL语句怎么写呀
[最优解释]
delete from tablename where UUID in
( select UUID from tablename where UUID not in
(select min(UUID) UUID from tablename ))
你测试下,应该可以了
[其他解释]
delete from table where rowid in
( select rowid from(
select rowid,
row_number() over(partition by 相同的字段 order by UUID desc) rn
from table where rn>1))
[其他解释]
谢谢
[其他解释]
3Q
