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 for second maximum salary in each in each department

Answer Posted / swastik

SELECT *
FROM
    (
     SELECT Ename, Deptno, Sal,
     DENSE_RANK(PARTITION BY Deptno
                ORDER BY Sal DESC
                )TopRank
     FROM Emp
     )
WHERE TopRank = 2

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is scalar and vector?

994


What are stored procedures in mysql?

1015


Can we use loop in sql?

967


What is mdf ldf and ndf?

993


What is union and union all keyword in sql?

1031


Does a user_objects view have an entry for a trigger?

1006


Can we use distinct and group by together?

1050


What is basic structure of pl sql?

1066


How can triggers be used for the table auditing?

1065


What are the different dml commands in sql?

1168


What is scalar function?

1047


what are the authentication modes in sql server? How can it be changed? : Sql dba

1419


which command using query analyzer will give you the version of sql server and operating system? : Sql dba

1054


How do you rename a table in sql?

1102


Do we need to create index on primary key?

922