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 a schema sql?
What operators deal with null?
how to get help information from the server? : Sql dba
ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..
What is dialect in sql?
Which data dictionary views have the information on the triggers that are available in the database?
what is an index? : Sql dba
What is autocommit sql?
What is column?
What is an escape character in sql?
How do you explain an index number?
What are the features of pl sql?
Why we use join in sql?
Enlist the data types that can be used in pl/sql?
What are keys in sql?