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 insert a new row into a table in oracle?

1165


Can we use oracle pl/sql block in core java? if so how? pls get back to me .....

2969


How to create id with auto_increment on oracle?

990


What is a sub query? Describe its types?

1019


why should i declare foreign key constraint as self relation instead of binary relation in tables ?

2047


How to sort output in descending order in oracle?

1047


What is memory advisor in Oracle?

1078


What is an external table?

1024


Explain coalesce function?

1207


can anyody please send me the dump for Oracle 10g certifications for DBA path?

2122


What happens if you use a wrong connect identifier?

1069


How to retrieve data from an cursor to a record?

1105


How to load a large xml file?

1058


What is a cursor variable?

1135


Explain temporal data types in oracle

1098