Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / sarmistha mohanty

select * from (
select SAL,
row_number() over (partition by 1 order by SAL DESC)
as rank
from <table name> ) where rank in (1,2)

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create an initialization parameter file?

1003


Explain the use of constraints option in exp command.

1009


What is the difference between alert log file and tarce file ?

2119


What is oracle instant client?

986


How are extents allocated to a segment?

1087


How do I know if oracle client is installed on windows?

975


what are actual and formal parameters?

1063


What is oracle update statement with inner join ?

1009


What is the use of oracle?

1003


How will you write a query to get a 5th rank student from a table student_report?

1827


Is a rollback possible to any savepoint?

1027


How to check the oracle tns settings?

1006


What is the usage of save points in oracle database?

927


How to drop a tablespace?

1010


Explain the difference between sap and oracle?

998