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 self contained sub query?

1124


How to find the source of a table in sql server?

1039


How to turn off warning messages during php execution?

1110


What are indexers?

1134


What is a db view?

951


How to get all stored procedures in sql server?

1063


What are the dmvs?

1074


What is the Main Difference between ACCESS and SQL SERVER?

1190


How to verify a user name with sqlcmd tool?

1122


Describe in brief system database.

1076


Is sql server 2016 free?

983


How to use old values to define new values in update statements in ms sql server?

1337


What do you understand by user-defined function in the sql server?

1011


How to download and install microsoft .net framework version 2.0?

1185


What is the current pricing model of SQL Azure?

104