oracle删除表里重复数据

delete from test_table1 a 
where 
(a.id,a.cd) in (select id,cd from test_table1 group by id,cd having count(*) > 1) 
and rowid not in (select min(rowid) from test_table1 group by id,cd having count(*)>1);

 

posted @ 2022-05-19 18:10  愿无违  阅读(18)  评论(0编辑  收藏  举报