how to find duplicate values using row_number and partition by how to find duplicate values using row_number and partition by oracle oracle

how to find duplicate values using row_number and partition by


You can't use an alias in WHERE, switch to a Derived Table:

select *from (   SELECT SC_CD,DIST_CD,THA_CD,UN_CD,FP_ID,      row_number() over(partition BY SC_CD, DIST_CD, THA_CD, UN_CD, FP_ID order by FP_ID) rn   FROM tmp_emp_area ) dtWHERE rn >1