oracle查询删除重复记录 --删除 delete from upsr_dict_dtl where id in ( select id from (select a.* ,row_number() over (partition by dict_no,opt_code,opt_name order by opt_code) rn from upsr_dict_dtl a where dict_no="PC1814" ) b where rn>=2) --查询 select * from upsr_dict_dtl where id in ( select id from (select a.* ,row_number() over (partition by dict_no,opt_code,opt_name order by id desc) rn from upsr_dict_dtl a where dict_no="DPAT_ID_TYPE_DG" ) b where rn>=2 ) --删除 delete from upsrdp.table_duzhaozhao c where rowid not in ( select min(rowid)--max(rowid) from upsrdp.table_duzhaozhao a group by prdu_num ) --rowid删除记录 delete from upsrdp.TABLE_DUZHAOZHAO where rowid="AAAaGcAAHAAGyYjAAB" 2022-5-8