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 / aditya kumar bisoi
SELECT EmpId,Salary
FROM(SELECT ROW_NUMBER() OVER(ORDER BY Salary Desc) AS [ROW_NUMBER],* FROM (SELECT DISTINCT Salary,Empid FROM EMPDetails)Emp)Emp1
WHERE ROW_NUMBER BETWEEN 2 AND 5
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Why use cursor in sql server?
How to update muliple row in single query?
Can we call future method from trigger?
Why I am getting this error when dropping a database in ms sql server?
What should be the fill factor for indexes created on tables? : sql server database administration
Why we need to use secondry database file? though, we can do same work using primary database file also.
what is difference between NULL and ISNULL in SQL Server 2008?
Can group functions be mixed with non-group selection fields in ms sql server?
What is bcnf normalization form?
What does the on update no action do?
Difference between Sql server reporting services and Crystal reports?
What are different types of database indexes?
Why we use the openxml clause?
what are the different types of SSRS reports?
What are the character string functions supported by sql server 2005?