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

Can we store pictures in the database and if so, how it can be done?

1045


Explain the use of Merge statement in oracle 11g

1029


What is backup in Oracle?

1004


How to view the data files in the current database?

1098


How to grant create session privilege to a user in oracle?

1002


What is Library Cache in Oracle?

1142


What is tns entry?

1151


How do we represent comments in oracle?

1048


What is merge statement used for?

1024


What is varray?

1136


How to compare dates in oracle sql?

1104


what are actual and formal parameters?

1104


What are the restrictions on external table columns?

1054


What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?

4523


How to create a table in a specific tablespace?

976