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

What is the sid in oracle?

961


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

1076


What is a read only transaction in oracle?

1018


What are the different pseudo commands? Explain in general?

1071


what is the scripts in data base?

2147


How to assign values to data fields in record variables?

1029


What are transaction isolation levels supported by oracle?

1060


What is the difference between count (*), count (expression), count (distinct expression)?

1001


How to turn on or off recycle bin for the session?

1103


what is the difference between data migration and production migration.

2337


How to resolve name conflicts between variables and columns?

1021


How do I connect to oracle database?

1107


What are the set operators union, union all, minus & intersect meant to do?

983


What is a sub query? What are its various types?

1164


Explain integrity constraints?

1102