how to find nth highest salary

Answer Posted / avinash

declare @n;
set @n = N
select * from tbl
where @n in (
select dense_rank over (order by salary) as rank_sal
from tbl )

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to download and install microsoft sql server management studio express?

660


What are the drawbacks of reporting in ssrs?

118


What is bookmark link in ssrs?

116


Does group by or order by come first?

621


What is the synonym of join?

604






Differentiate between a having clause and a where clause.

608


What is the meaning of resultset type_scroll_insensitive?

646


How can you list all the columns in a database?

621


What is data source document?

638


If a stored procedure is taking a table data type, how it looks?

5955


What are different types of schemas?

603


What is the use of custom fields in report?

643


What are the disadvantages of using querystrings to send data from one page to another?

675


what is the difference between a primary key and a unique key? : Sql server database administration

626


What is repeatable read?

615