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 subquery? : Sql dba
Can we join two tables without common column?
Is sql easier than java?
Is inner join faster than left join?
Why is a trigger used?
how to rename an existing table in mysql? : Sql dba
What is user defined functions?
Is mariadb nosql?
Can we call stored procedure in function?
Can you rollback after commit?
What operating systems are supported by oracle sql developer?
How would you pass hints to the sql processor?
How do you truncate?
Explain the difference in execution of triggers and stored procedures?
what are the join types in tsql? : Transact sql