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 write a query with a left outer join in oracle?

1002


Can we convert a date to char in oracle and if so, what would be the syntax?

957


How to list all tables in your schema?

990


How do you bind variables in oracle?

928


Does facebook use oracle?

979


What query tells you how much space a tablespace named test is taking up, and how much space is remaining?

2209


How to calculate date and time differences in oracle?

991


What is save point in oracle database?

1239


what is meant by magic query

2136


How many types of segments in Oracle?

1012


How many categories of data types?

937


What are the different types of failures that occur in Oracle database?

1015


How to start a new transaction in oracle?

1015


How to select some columns from a table in oracle?

1003


Explain what are synonyms used for?

981