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
How do I view a sql database?
Can we use the cursor's to create the collection in PL/SQL?
What is a stored procedure in sql with example?
how to load data files into tables with 'mysqlimport'? : Sql dba
What is pls_integer in pl sql?
Can sql developer connect to db2?
what is timestamp in mysql? : Sql dba
what are the types of join and explain each? : Sql dba
What is scalar function?
What is the most common sql injection tool?
what is a materialized view? : Sql dba
What are the set operators in sql?
Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?
What is the default isolation level in sql server? : Transact sql
What does varchar include?