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

How to connect to oracle using service name instead of sid?

544


What exactly do quotation marks around the table name do?

537


How to define an anonymous procedure with variables?

535


What are the different types of synonyms?

581


can anyody please send me the dump for Oracle 10g certifications for DBA path?

1676






ur a sql devoloper...what is the process in ur company for finding the database BUGS .. seperate DB testers are there? or devr.s are manage? if DB TESTERS in there what is the process

1739


How to set up autotrace for a user account?

586


How to count groups returned with the group by clause in oracle?

562


How many data types are supported?

610


Explain the use of rows option in exp command.

577


Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.

1524


How to resolve name conflicts between variables and columns?

560


What is blob datatype?

559


What are the general rules on data consistency?

576


What is an oracle transaction?

573