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
How to add the custom code in Report?
How do I find information about the install locations for the various instances running on a computer?
How to set database to be read_only in ms sql server?
How many levels of sp nesting are possible?
What are the five major components of a dbms?
What does it mean if @@cursor_row returns a negative number?
What is difference between clustered and non clustered index?
Explain filtered indexes benefits?
How we create SQL Server 2005 Reporting Services ? Give me Sample
Where sql server usernames and passwords are stored in a sql server?
Explain what is analysis service repository?
List down some advantages of sql stored procedure?
What is the difference between osql and query analyzer?
Do you know what is xpath?
How many types of schemas are there?