How to Select second Maximum salary in a Table ?

Answer Posted / abhijit

select max(sal) from table_name where
sal<(select max(sal) from table_name);

or

select sal from(select sal,dense_rank() over(order by sal
desc)
as rnk from table_name) where rnk=2;

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to speed up webrick?

827


How to update values on multiple rows in oracle?

776


Explain rename?

737


What are the ansi data types supported in oracle?

707


How to use group functions in the select clause using oracle?

818


What types of joins are used in writing subqueries?

745


How to start a new transaction in oracle?

817


How to create tables for odbc connection testing?

717


What is an oracle tablespace?

785


How do I uninstall oracle 11g?

797


Explain oracle left join with an example?

767


How to connect the oracle server as sysdba?

819


Oracle

2134


What is null value in oracle?

836


What is parameterized cursor in oracle?

809