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

Why use subqueries instead of joins?

1138


What is primary key and foreign key?

1014


What is the basic structure of an sql?

1159


What is difference between stored procedure and trigger?

1252


how many ways we can we find the current date using mysql? : Sql dba

1146


What is the cause of mutating table error and how can we solve it?

1099


What is self-join and what is the requirement of self-join?

1192


Do stored procedures prevent sql injection?

1015


What does select top 1 do in sql?

1142


How much ram can sql express use?

1041


Does sql full backup truncate logs?

1080


Explain architecture of sql server notification services?

1112


How delete a row in sql?

1043


How to get unique records from a table?

1024


How to add new employee details in an employee_details table with the following details

1137