oracle查询表中字段里数据是否有重复
展开全部
查询A表中字段a、b重复的数据:
select a,b from A group by a,b having count(*) > 1
删除表中多余的重复记录(多个字段),只留有rowid最小的记录
delete from 表 A
where (A.a,A.b) in
(select a,b from A group by a,b having count(*) > 1)
and rowid not in
(select min(rowid) from Z group by a,b having count(*)>1)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询