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 to find nth highest salary

Answer Posted / nitin munjani

Using Row_Number() function

Here N refers the Nth highest salary

select empid,empname from mstemployee where empsalary in (
(select empsalary from
(select Row_Number() over(order by empsalary desc)
rownm,empsalary from mstemployee
group by empsalary) o where rownm=N))

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 a trigger in sql server?

1094


What is an expression in ms sql server?

1015


What is a matrix in ssrs?

135


What is indexed view? How to create it?

932


What is the difference between a local and a global temporary table?

1055


Do you know what are the properties of the relational tables?

983


What are system databases into sql server (2005/2008) : sql server database administration

967


What is the New in SQL server 2008?

920


What is difference between table aliases and column aliases? Do they affect performance?

913


What is change data capture (cdc) in sql server 2008?

981


How to create a large table with random data for index testing in ms sql server?

981


What do you mean by recursive stored procedure?

884


How to download microsoft sql server 2005 express edition?

978


Is it possible to run multiple publications and different type of publications from the same distribution database? : sql server replication

938


How to set the current database in ms sql server?

1012