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

Explain what does a control file contain?

614


Explain the use of Merge statement in oracle 11g

598


How to update a table row with a record?

598


What is open database communication (odbc) in oracle?

551


What is oracle sid?

510






What is the fastest query method to fetch data from the table?

866


Give the different types of rollback segments.

583


Explain the use of ignore option in imp command.

577


Explain the use of record option in exp command.

541


Is it possible to split the print reviewer into more than one region ?

1840


What is an oracle user role?

572


Design database draw er diagram for a certain scenario ?

4106


Assuming that you are an End User How to find that in the payment Batch some of the Invoice was  Missing To pay How to find That??

1277


Explain the different normalization forms?

598


How do we represent comments in oracle?

631