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 difference between Union and Union all. Which is faster.
Could you please provide oca (oracle 10g) dumps for my certification ?
What is constant in pl sql?
What is field delimiter?
Define the select into statement.
Is sql injection illegal?
What is rowtype?
How can you fetch first 5 characters of the string?
what are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee (eno int(2),ename varchar(10)) ? : Sql dba
What is difference between nchar and nvarchar?
Explain cursor types?
what is collation? : Sql dba
Does truncate require commit?
How many types of literals are available in pl sql?
Write a sql query to find the names of employees that begin with ‘a’?