话不多数上代码:
我在Oracle数据库查数据,发现重复数据,于是我想把重复条数以及具体数据查出来:
下面是数据
然后我需要知道重复多少条 (重复十条,也就是有五条数据相同)
SQL:
select COUNT(*) from acsprd.parameters_lowner where pow_low_code in (SELECT pow_low_code FROM acsprd.parameters_lowner group by pow_low_code having COUNT (pow_low_code) > 1)
然后拿到重复条数,我需要知道是那些数据重复的:
SQL:
SELECT pow_low_code FROM acsprd.parameters_lowner group by pow_low_code having COUNT (pow_low_code) > 1
最后查看具体重复数据:
SQL:
SELECT * from acsprd.parameters_lowner p WHERE p.pow_low_code IN ('BMW','JAG','LAR','MAUK','VOL')
--------重复记录
---------end
本文来自博客园,作者:綦霖,转载请注明原文链接:https://www.cnblogs.com/yc-weblog/p/9817462.html