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 are the new features in SSRS?

134


How to rename an existing column with the "sp_rename" stored procedure in ms sql server?

1102


What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?

1147


What are truncate options available in sql server? : sql server database administration

1034


Do you know what is xpath?

1088


How can I change procedure name in sql server?

1050


How to set a database state to offline in ms sql server?

1046


How to rename an existing table with the "sp_rename" stored procedure in ms sql server?

1030


Why do we use stored procedures in sql server?

942


What is a View ? Can we insert, Update and delete a view?

995


How to find which stored procedure is currently running in sql server?

996


What is the server name for sql management studio?

1025


How can you set the threshold at which sql server will generate keysets asynchronously?

990


What is data source object?

1005


What are the 10 characteristics of data quality?

956