How to Select second Maximum salary in a Table ?

Answer Posted / sunil

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)
as rnk from table_name) where rnk=2;

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I combine multiple rows into a comma-delimited list in oracle?

787


What is a tns file?

715


Why use resource manager in Oracle?

862


How to start an oracle instance?

765


Explain an integrity constrains?

879


What is object data modeling?

693


What is the difference between substr & instr functions?

822


What are the numeric comparison operations?

842


what is the difference between restoring and recovering?

753


1) Does oracle have any table which contain all the exceptions and it's code internally?

1504


Explain the use of record option in exp command.

741


How will you identify oracle database software release?

746


Describe varray?

828


What is tns service name?

826


What is a static data dictionary in oracle?

751