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 the minimum client footprint required to connect c# to an oracle database?

569


Can we call procedure inside function in oracle?

614


11. Display the client number and name and the client number and name of the person who referred that client.

1922


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

555


Difference between oracle's plus (+) notation and ansi join notation?

580






Is there a combination of "like" and "in" in sql?

585


How to use "in out" parameter properly?

618


How to run create database statement?

579


What is a data lock in oracle?

615


How to define a sub function?

671


WHAT IS THE DEFINITION OF DEFAULT CUSTOMER IN AR?

1705


What is open database communication (odbc) in oracle?

549


What is meant by an index?

629


How to use existing values in update statements using oracle?

545


Explain the different normalization forms?

596