how to find nth highest salary
Answer Posted / rahul tripathi
The Genral answer which can work on any SQL:-
select salary from emp e1 where (n-1)=(select count(*)
from emp where salary > e1.salary )
Rahul Tripathi
rahultripathi@inkanpur.com
| Is This Answer Correct ? | 249 Yes | 76 No |
Post New Answer View All Answers
What is an entity-relationship diagram (erd)?
What do you understand by mirroring?
What is the difference between a function and a stored procedure?
Your company has 50 branches all over the country all the branches, including the head office have sql server as the database every night all 50 branches upload certain information to the head office which replication topology is best suited for the above scenario?
What is the order in which the sql query is executed?
What is the difference between grant and with grant while giving permissions to the user?
in the physical file layout, where should the transaction log be stored in relation to the data file? : Sql server administration
I create a separate index on each column of a table. What are the advantages and disadvantages of this approach? : Sql server database administration
What is Sqlpaging in SqlServer 2005 ?
Explain primary key?
How to enter date and time literals in ms sql server?
What is primary key, unique key, and foreign key?
how to determine the service pack currently installed on sql server? : Sql server database administration
what is difference between view and Dip.
Does full backup break log chain?