Re: helpme~ In oracle9i how to use rank over function

From: Jusung Yang <JusungYang_at_yahoo.com>
Date: 26 Mar 2003 13:41:47 -0800
Message-ID: <130ba93a.0303261341.698d4d36_at_posting.google.com>


Try dense_rank() in stead.

  • Jusung Yang

c2061_at_bcline.com (c2061_at_bcline.com) wrote in message news:<45064e2c.0303261122.2f663126_at_posting.google.com>...
> SQL statement :
> select
> deptno,
> ename,
> sal,
> rank() over ( partition by deptno order by sal desc) as rank
> from emp
> where deptno=20
>
> result :
> deptno|ename | sal |rank
> 20 | SCOTT | 3000 |1
> 20 | FORD | 3000 |1
> 20 | JONES | 2975 |3
> 20 | ADAMS | 1100 |4
> 20 | SMITH | 800 |5
>
> so i want to remove duplicate rank value
> how to get result under?
>
> deptno |ename | sal |rank
> 20 |SCOTT | 3000 |1
> 20 |FORD | 3000 |1
> 20 |JONES | 2975 |2
> 20 |ADAMS | 1100 |3
> 20 |SMITH | 800 |4
>
> thank for reading my question..^^
Received on Wed Mar 26 2003 - 22:41:47 CET

Original text of this message