Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

distinct and row_number

809543Dec 16 2010 — edited Jul 31 2012
I want to list distinct sal and add row number. I tried the query , it doesn't work, the sal has duplicate. How to do it ?

Thanks.
select DISTINCT sal , row_number() over (order by sal asc) from emp order by sal asc
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2012
Added on Dec 16 2010
6 comments
9,097 views