Oracle去除数据的常用方法
- dinstinct
- row_number()
select * from (select t1.*, row_number() over(partition by t1.col_2, t1.col_3 order by 1) rn from nayi224_180824 t1) t1 where t1.rn = 1 ;
针对指定列,查出所有重复行
select *
from (select t1.*,
count(1) over(partition by t1.col_2, t1.col_3) rn
from nayi224_180824 t1) t1
where t1.rn > 1
;