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

Find top Nth employee from each department in terms of
salary?

Answer Posted / sandeep modapathi

SELECT DISTINCT MIN(SALARY),DEPARTMENT
FROM (SELECT TOP ((SELECT COUNT(DISTINCT DEPARTMENT) FROM
EMPLOYEE)*@N)
SALARY,DEPARTMENT
FROM EMPLOYEE ORDER BY SALARY DESC
) AS CUR1 GROUP BY DEPARTMENT


try it out ..................
it will show you the Nth top salary for each department

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to enter date and time literals in ms sql server?

1070


how you can move data or databases between servers and databases in sql server? : Sql server administration

1030


When I run the sql server 2000 setup, it just hangs. What do I do?

1129


how many bits ip address consist of? : Sql server database administration

944


What are the different types of sub-queries?

1092


You want to use a perspective in an mdx query. How do you select the perspective?

246


You have a stored procedure, which execute a lengthy batch job. This stored procedure is called from a trigger you do not want to slow the data entry process you do not want trigger to wait for this batch job to finish before it completes itself what you can do to speed up the process?

1194


How to generate random numbers with the rand() function in ms sql server?

1230


How to convert a numeric expression from one data type to another?

1099


Mention the 3 ways to get a count of the number of records in a table.

1029


Tell me extended events in sql server 2008?

1055


Differentiate between sql temp table vs table variable?

927


When cursors are useful?

1172


How to insert new line characters into strings?

1034


How many tables can be joined in SQL Server?

1115