Tuesday, March 31, 2015

DISTINCT only for some columns

https://community.oracle.com/thread/1120347

select *
  from (select col1,
               col2,
               col3,
               col4,
               col5,
               col6,
               row_number () over (partition by col1, col2, col3, col4, col5 order by null) rn
          from table1)
 where rn = 1

No comments:

Post a Comment