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

Explain the use of keyword with encryption. Create a store procedure with encryption?

630


What is row-level compre?

615


Explain transaction server consistency?

605


Can foreign key be deleted?

606


you added a row to a view, but the row is not shown on the view. Explain how this can happen, and how you can remedy the situation

610






Define model database?

652


What is the full form of ddl?

589


Does union all remove duplicates?

700


what is the difference between them (ethernet networks and token ring networks)? : Sql server database administration

585


What is the purpose of forms?

590


Explain transaction server distributed transaction?

595


Do you know the cursor optimization tips?

664


Why transaction is important?

637


What is the user of Primary key?

663


What is a primary key?

615