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 will you write a query to get a 5th rank student from a table student_report?

1843


What is the difference between 10g OEM and 11g OEM?

949


What is the effect of setting the value "all_rows" for optimizer_goal parameter of the alter session command? What are the factors that affect optimizer in choosing an optimization approach?

1030


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

1000


What is columnar storage what is the advantage?

1034


Explain oracle’s server parameter file.

973


How to generate query output in html format?

1094


What are the attributes that are found in a cursor?

1045


How to drop an index in oracle?

1051


What are named parameters?

1071


What is the difference between pre-select and pre-query?

1190


What are the general rules on data consistency?

989


What are the execution control statements?

1045


How many categories of data types?

977


In the oracle version 9.3.0.5.0, what does each number shows?

1278