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
what are the tables used in health care domain project and columns used in report?
How would you format some text using css to be verdana and bold?
Explain is it the job of a business analyst or systems analyst to draw the class diagram?
what is universe null
(1) Is it possible to create measures using objects from different context. (2) If cross context measures are not possible then what about @aggregate_aware() function ,here we use objects from different contexts. (3)Two measures from two different context ,can they be summed at report level.
What three things do you consider to be the most important factors for a manager?
What are all the points to keep in consideration, while we are migrating the Universes,Reports from BO5.1.6 to BO 6.5? Is is compatible to migrate like this? Does it effect the filters in Reports and Join in the Universe?
Is there any other repository domains rather than universe, security, document?
what will be the contents for a functional requirements specifications
Can we configure two instances of CMS pointing to two different CMS system databases?
How were the reports scheduled and how to resolve unexecuted documents?
Explain what is aggregate table and aggregate fact table ... Any examples of both?
What are the data types present in bo? What happens if we implement view in the designer and report?
How to sort the dynamic objects alphabetically on the Universe based on and SQL Server
U r project in which stage in implementation?