Write a query to find five highest salaries from EMP table.
(there is a column SALARY)
Answer Posted / sreenivasreddy
SELECT ROWNUM, E1.*
FROM (SELECT EName, Deptno, Sal,
DENSE_RANK()
OVER(ORDER BY Sal DESC) EmpRank
FROM Emp
GROUP BY Deptno, EName, Sal
ORDER BY EmpRank) E1
WHERE E1.EmpRank <= 5
ORDER BY ROWNUM
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is the unique index?
how do you control the max size of a heap table? : Sql dba
how to create a new view in mysql? : Sql dba
What are the uses of sysdate and user keywords?
explain commit and rollback in mysql : sql dba
Mention what is the use of function "module procedure" in pl/sql?
what are date and time data types? : Sql dba
What is the sql*loader? : aql loader
How many types of triggers exist in pl/sql?
How does postgresql compare to mysql?
What is pl sql block structure?
What is a sql instance vs database?
Why procedure is used in sql?
What is data definition language?
what are the authentication modes in sql server? How can it be changed? : Sql dba