How to find the second largest salary in the emp database and
also How to find 3rd,4th and so on ........ in the emp database
plz mail the answer @ mak2786@gmail.com
Answer Posted / sarat
TO FIND THE Nth HIGHEST SAL IN EMP TABLE
SELECT MIN (salary) as NthSalary FROM emptable WHERE
salary IN ( SELECT DISCINCT TOP N salary FROM emptable
ORDER BY salary DESC )
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
What is repeatable read?
What samples and sample databases are provided by microsoft?
What is logshipping and its purpose?
What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?
Can we use where clause in union?
What is spatial and temporal data?
How do I find sql server instance name?
How to run queries with sql server management studio express?
What are the types of database recovery models?
What is difference between primary key and foreign key?
Why use triggers?
In what version of sql server were synonyms released?
Can we call future method from queueable?
What are the new features in SQL Server 2005 when compared to SQL Server 2000?
What factors you will consider calculating the storage requirement for that view?