Query to get max and second max in oracle in one query ?

Answer Posted / purna chowdary

Select Sal From Emp A
WHERE 1=(Select Count(Sal) From Emp B
WHERE B.Sal>A.sal)
GROUP By Sal Desc

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is program global area (pga) in oracle?

613


What is a initialization parameter file in oracle?

588


How to create tables for odbc connection testing?

501


What is concurrency in oracle?

553


 What are the oracle DML commands possible through an update strategy?

592






Differentiate between pre-select and pre-query?

636


What is user managed backup in Oracle?

622


What are the original export and import utilities?

578


Explain the use of online redo log files in oracle.

597


Calculate difference between 2 date / times in oracle sql?

584


How do I learn what codesets are available in oracle?

581


How to declare a local variable?

608


Explain what does a control file contain?

619


How to create a new table by selecting rows from another table?

562


Explain the use of full option in exp command.

599