龙空技术网

oracle查询删除重复记录

在水一方357159258 252

前言:

今天兄弟们对“oracle查出重复的数据吗”都比较注意,看官们都需要学习一些“oracle查出重复的数据吗”的相关知识。那么小编在网络上网罗了一些对于“oracle查出重复的数据吗””的相关内容,希望我们能喜欢,咱们快快来学习一下吧!

oracle查询删除重复记录

--删除

delete from upsr_dict_dtlwhere id in (select idfrom (select a.*,row_number() over (partition by dict_no,opt_code,opt_name order by opt_code) rnfrom upsr_dict_dtl awhere dict_no='PC1814') bwhere rn>=2)

--查询

select *from upsr_dict_dtlwhere id in (select idfrom (select a.*,row_number() over (partition by dict_no,opt_code,opt_name order by id desc) rnfrom upsr_dict_dtl awhere dict_no='DPAT_ID_TYPE_DG') bwhere rn>=2)

--删除

delete from upsrdp.table_duzhaozhao cwhere rowid not in(select min(rowid)--max(rowid)from upsrdp.table_duzhaozhao agroup by prdu_num)

--rowid删除记录

delete from upsrdp.TABLE_DUZHAOZHAOwhere rowid='AAAaGcAAHAAGyYjAAB'

2022-5-8

标签: #oracle查出重复的数据吗