find out the third highest salary?

Answer Posted / harmeet

Hi, this query will gives the third highest salary from table

select * from emp e
where 3 = (select count(sal) from emp
where e.sal < sal);

To dispay 5th highest salary, just change the number 3 to 5.
Like that we can find top N salaries.

I hope i'm not wrong.

Is This Answer Correct ?    44 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between post-database commit and post-form commit?

525


interview questions with answer for cts

2098


How to create a table interactively?

574


How to write text literals in oracle?

626


How translate command is different from replace?

562






How to create a testing table in oracle?

560


Why use resource manager in Oracle?

674


How to retrieve values from data fields in record variables?

581


What are the set operators union, union all, minus & intersect meant to do?

576


What is Library Cache in Oracle?

655


What is an oracle tablespace?

621


Explain the difference between sap and oracle?

587


Explain database link?

678


How to view all columns in an existing table?

558


What is the exact use of Collections?

1696