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
Differentiate between function and procedure in oracle.
What is an oracle user role?
In oracle there is column command, how will you explain that?
How to drop a stored function?
Why we use bulk collect in oracle?
what is the difference between substr and instr function in oracle?
You have 4 instances running on the same UNIX box. How can you determine which shared memory and semaphores are associated with which instance?
What is data block in Oracle?
Explain the use of record length option in exp command.
20. Using a set operator, display the client number of all clients who have never placed an order.
How to pass a parameter to a cursor in oracle?
How to open and close an explicit cursor in oracle?
Does oracle partitioning improve performance?
what is partitioning? Types of partitioning. explain? what is the new kind of partitioning type introduced in 9i?
What is the difference between $oracle_base and $oracle_home?