Oracle 删除根据id 删除重复数据

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_17079071/article/details/69258086

查询重复的数据

select * from t_creditobjection a where (a.id) in  (select id from t_creditobjection group by id  having count(*) > 1)

删除重复的数据


delete from t_creditobjection
where id in (select   id from t_creditobjection group by   id   having count(id) > 1)
and rowid not in (select min(rowid) from   t_creditobjection group by id having count(id )>1)

猜你喜欢

转载自blog.csdn.net/qq_17079071/article/details/69258086
今日推荐