Wroking with DENSE_RANK function [message #400472] |
Tue, 28 April 2009 05:49  |
|
Hi,
i am working with DENSE_RANK function, i want below behaviour mark in red color
SELECT deptno,
ename,
sal,
DENSE_RANK() OVER (PARTITION BY deptno ORDER BY sal) "rank"
FROM emp
WHERE deptno = 30;
DEPTNO ENAME SAL rank
---------- ---------- ---------- ----------
30 JAMES 950 1
30 WARD 1250 2
30 MARTIN 1250 2 - Here it should be 3
30 TURNER 1500 3
30 ALLEN 1600 4
30 BLAKE 2850 5
So i want DENSE_RANK to generate increasing number for the same sal person.
Is it possible???
Thanks in advance
|
|
|
|
|
|
|