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 / roopa

SELECT MAX(E1.sal), MAX(E2.sal)
FROM emp E1, (SELECT sal FROM emp
WHERE sal NOT IN ( SELECT MAX(sal) FROM emp)) E2

Is This Answer Correct ?    7 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to shutdown your 10g xe server from command line?

1152


What language does oracle use?

1168


How to delete a column in an existing table?

1130


What is null value in oracle?

1158


What is a cursor variable?

1215


What is meant by a deadlock situation?

1154


how to clone 9i Database on to 10g Database.

2384


Typically, where is the conventional directory structure chosen for Oracle binaries to reside?

2191


How to rename an existing table?

1217


How to define a data field as not null?

1162


15. Display the item_cost and then truncate it to the nearest hundred, ten, unit, tenth and hundredth.

2356


What is Java Pool in Oracle?

1246


What happens to the current transaction if the session is ended?

1136


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

1275


What is a dead lock in oracle?

1175