-- 查找重复值及最小的id
select min (id), province, city, count (*) cnt
from t
group by province, city
having count (*) > 1;
-- 保留最小的重复值
delete from t
where id not in (
select min(id) from t
group by province, city
);
oracle查询/去除重复值
最新推荐文章于 2024-07-11 16:22:36 发布