how to find nth highest salary
Answer Posted / p rem satyam
This is perfect
...............................
select * from emp e1 where (N-1)=( select
count(distinct(e2.sal) from emp e2 where e2.sal > e1.sal)
where N is level of sal. suppose you want 3rd higest sal then
in place u write 3 i.e write (3-1).
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain what are various ways to enhance the ssrs report?
What is transaction server implicit?
What are the types of dml?
How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?
What are the different types of cursor?
If I delete a template from the list in sql studio, will it be deleted from the hard disk? : sql server management studio
Explain the working of sql privileges?
tell me what is blocking and how would you troubleshoot it? : Sql server database administration
What is change data capture (cdc) feature?
How do I perform an unattended install of sql server 2000?
What is sql sandbox in sql server?
When should you use an instead of trigger?
What is ms sql server service broker?
What are alternate keys?
What is full outer join in sql server joins?