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 are various ways to enhance the ssrs report?
As a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this?
Can the “if update (colname)” statement be used in a delete trigger?
what's sql server? : Sql server database administration
How use inner join in sql server?
Suppose you want to implement the following relationships while designing tables. How would you do it?a.) One-to-oneb.) One-to-manyc.) Many-to-many
how many no of arguments can be passed in procedures and functions
How to define and use table alias names in ms sql server?
What is executereader?
How do I completely remove sql server instance?
What do you mean by SQL injection attack?
You have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem?
What are information schema views?
How to create a view using data from another view?
Explain something about security and SQL Azure?