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

Is it possible to insert comments into sql statements return in the data model editor ?

2530


How to get last row id?

958


Can the query output be sorted by multiple columns in oracle?

960


How to create a table in a specific tablespace?

931


How to convert times to characters in oracle?

1001


22. Display the order number, number of lines in the order, total number of items and total value for all orders that have a total value greater than $100

1977


What is the disadvantage of User defind function?

2263


Explain drop constraint oracle?

1013


What is Virtual Private Database in Oracle?

1038


Explain the different normalization forms?

1035


What is columnar storage what is the advantage?

1015


How to retrieve values from data fields in record variables?

1066


What is transaction control statement and how many types of transaction control statement in Oracle?

1107


What is hash cluster in oracle?

1123


How to select some rows from a table in oracle?

1036