find out the second highest salary?

Answer Posted / janmejaya

select top(1) * from employee where salary in (select
distinct top(2) salary from employee order by salary desc)
order by Salary




Above query is dynamic, if u want 3rd highest then just
change 2 to 3 , Please Try It

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to drop an index?

545


Is oracle the best database?

522


What is oracle used for?

536


What are the different types of failures that occur in Oracle database?

605


How to apply filtering criteria at group level in oracle?

587






How to use "in out" parameter properly?

617


How to display row numbers with the records?

588


What privilege is needed for a user to create indexes in oracle?

578


How to assign data of the deleted row to variables?

581


Is oracle an open source?

638


How to convert characters to numbers in oracle?

596


What happens to the current transaction if the session is killed?

536


You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?

1460


What is sequence?

624


How to delete a user account in oracle?

551