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
Find columns used in stored procedure?
What is sql service broker?
Explain what is the difference between union and union all?
What is schemabinding a view?
Can you type more than one query in the query editor screen at the same time?
What is the report builder?
What is the difference between clustered index and primary key?
What are the essential components of sql server service broker?
How to set database to be read_only in ms sql server?
How to stop log file growing too big?
How to modify an existing user defined function?
What is primary key and example?
What does ss stand for sexually?
What are the different index configurations a table can have?
What happens if you are trying to access a schema not owned by you?