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

how can find the second max sal for every group(i.e i want
group the data based on key and find the second max sal for
every group

Answer Posted / nathan

SELECT *
FROM (SELECT deptno, sal,
DENSE_RANK () OVER (PARTITION BY deptno ORDER
BY sal DESC)

ranks
FROM emp)
WHERE ranks = 2;

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to generate query output in html format?

1063


Explain the use of indexes option in imp command.

1120


What is the difference between I and G in Oracle?

1055


What is the use of file param in imp command?

1136


What happens to the indexes if a table is recovered?

959


What is pragma autonomous transaction in oracle?

1020


What is a nvl function? How can it be used?

978


what are archived logs?

2166


How can I combine multiple rows into a comma-delimited list in oracle?

1020


Can you drop an index associated with a unique or primary key constraint?

985


How to connect to a remote server?

1085


How i can handle exception in large code like 1000 line without distrubing the code or without exception handler sction?

3175


What is Segment Advisor in Oracle?

1073


How index is implemented in oracle database?

971


What are the uses of synonyms?

1106