Oracle 查詢重複數據

1、查找表中多餘的重複記錄(單個字段)

select  *  from table 
where  字段  in  (select  字段  from  table group by 字段 having count(字段) > 1)

2、查找表中多餘的重複記錄(多個字段) 

select * from table a
where (a.字段1,a.字段2) in (select 字段1,字段2 from table group by 字段1,字段2 having count(*) > 1)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章