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 is literal?
How to get a list of all user accounts in the database?
From the following identify the non schema object: packages, triggers, public synonyms, tables and indexes.
Explain what are the characteristics of data files?
what is dynamic SGA and static SGA
What is the recommended interval at which to run statspack snapshots, and why?
How to execute a stored program unit?
Explain an index?
How many types of cluster table in Oracle?
How to create a table in a specific tablespace?
What is meant by a deadlock situation?
What is oracle latest version?
What privilege is needed for a user to connect to oracle server?
What are the ansi data types supported in oracle?
What happens if the imported table already exists?