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 / amit golia

SELECT min(sal) FROM(SELECT DISTINCT(sal) FROM emp ORDER
BY sal DESC) WHERE ROWNUM<=2;

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain a private synonyms?

983


What is the difference between post-database commit and post-form commit?

1108


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

927


What is ceil and floor in oracle?

1011


Design database draw er diagram for a certain scenario ?

4529


What view(s) do you use to associate a users SQLPLUS session with his o/s process?

2309


What is oracle database 10g express edition?

1075


Difference between pre-select and pre-query

1031


Explain oracle instance.

1107


What are the execution control statements?

1018


What is the difference between PFILE and SPFILE in Oracle?

996


Explain an index?

1095


How does the on-delete-cascade statement work?

1061


What are the ways tablespaces can be managed and how do they differ?

2274


does the query needs a hint to access a materialized view?

1817