find out the third highest salary?
Answer Posted / amitabh sharma
Here are 2 queries for finding 3rd highest salary:
select * from emp e
where 3 = (select count(sal) from emp
where e.sal < sal);
SELECT * FROM
(
SELECT Ename, SAL, dense_Rank() OVER (ORDER BY SAL DESC )
RANKNEW FROM EMP)
WHERE RANKNEW = 3
Regards,
Amitabh Sharma
| Is This Answer Correct ? | 1 Yes | 5 No |
Post New Answer View All Answers
what happened to the global index when I truncate the data in one of the partition?
What is the difference between count (*), count (expression), count (distinct expression)?
How to define an anonymous procedure with variables?
Explain the blob datatype?
What is raw datatype?
What are the oracle built-in data types?
When do you get a .pll extension in oracle?
What is the difference difference between $ORACLE_HOME and $ORACLE_BASE.
What is logical backup in oracle?
Explain the characteristics of oracle dba?
Explain the truncate in oracle?
Explain the use of grant option in exp command.
What are the system predefined user roles?
Why do we use bulk collect in oracle?
What is the quickest way to export a table to a flat file?