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

SELECT SAL SECOND_MAX_SAL FROM (SELECT SAL,DENSE_RANK() OVER(ORDER BY SAL DESC) RANK FROM EMP) WHERE RANK=2;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?

1984


What are the various types of snapshots ?

1082


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

1127


what is meant by magic query

2231


Explain the use of owner option in exp command.

1099


Explain do view contain data?

1052


How to create a table in a specific tablespace?

1028


How to rollback the current transaction in oracle?

1104


Why does for update in oracle 8 cause an ora-01002 error?

1047


Point out the difference between user tables and data dictionary?

1036


How to use subqueries in the from clause in oracle?

1165


What is the use of file param in imp command?

1216


What is a partition in oracle?

1205


What is literal?

1062


Explain index?

1307