Answer Posted / shikha
The DENSE_RANK function computes the rank of a row in an
ordered group of rows.Rows with equal values for the
ranking criteria receive the same rank.
For eg.
To Show the set of sales people who make the top 3
salaries - that is, find the set of distinct salary
amounts, sort them, take the largest three, and give me
everyone who makes one of those values.
SELECT * FROM (
SELECT deptno, ename, sal,
DENSE_RANK()
OVER (
PARTITION BY deptno ORDER BY sal desc
) TopN FROM emp
)
WHERE TopN <= 3
ORDER BY deptno, sal DESC
/
DEPTNO ENAME SAL TOPN
---------- ---------- ---------- ----------
10 KING 5000 1
CLARK 2450 2
MILLER 1300 3
20 SCOTT 3000 1 <--- ! (in
case of rank
JONES will have
3 and dense
rank will have 2)
FORD 3000 1 <--- !
JONES 2975 2
ADAMS 1100 3
30 BLAKE 2850 1
ALLEN 1600 2
30 TURNER 1500 3
| Is This Answer Correct ? | 11 Yes | 6 No |
Post New Answer View All Answers
Explain what are the steps to do to use alerts in bo?
What sort of existing documents should business analysts refer to when starting on a new project?
8. How much supervision have you typically received in your previous job?
how to prepare the documentation in business objects and where to get the requirement?
Explain how to execute the plsql procedure from the report by clicking with mouse?
In banking domain how many Fact tables,Dimension table are present?
What if a cartesian product pop up block appears when running a report. Does it give wrong values? How to solve this issue?
please explain me with the real time tables on how aggregate tables are created and how aggregate awareness is addressed to it.
What is the difference between slice and dice and cross tab report?
what will be the contents for a functional requirements specifications
What is difference between webi and infoview?
What is object stores?
What is thumbnail?
Can you please send me the migration related issues .
What is the dense rank?