how to find nth highest salary

Answer Posted / yogesh

select e2.salary
from emp e1
join emp e2
on e1.salary >= e2.salary
group by e2.salary
having count(e2.salary) = 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 do you understand by mirroring and mention the advantages of the mirroring?

675


What are sparse columns?

654


What do you know about system database? : SQL Server Architecture

572


What are trace files?

611


What part does database design plays a role in performance of an sql server-based application?

615






Define master database?

658


Explain what are the different index configurations a table can have?

773


What is sql injection? How to protect against sql injection attack?

641


How can you stop stored procedures from recompiling?

564


What is after dml trigger?

663


What are the different types of triggers in SQL SERVER?

618


What is dimension table? : sql server analysis services, ssas

650


Does a sql server 2005 select statement require a from?

696


can SSRS reports Cache results?

115


What is transaction server auto commit?

658