From the internet:
1) Delete duplicates
delete from t
where rowid in (
select rid
from t
)
where rn <> 1 )
2) Find how many duplicates
select cust_seg_nbr, count(*) from t group by cust_seg_nbr
本文介绍了如何从数据库中删除重复项并查找重复数量的两种方法,使用了SQL语句实现,包括使用ROW_NUMBER函数对数据进行排序并分组,以及利用子查询筛选出重复记录。
From the internet:
1) Delete duplicates
delete from t
where rowid in (
select rid
2) Find how many duplicates
select cust_seg_nbr, count(*) from t group by cust_seg_nbr
2416

被折叠的 条评论
为什么被折叠?