I Have Employee table having column name as ID,SALARY
how to get second max salary from employee table with id
ex
ID SALARY
1 20000
7 37000
2 5000
Answer Posted / ankit nanda
select [Salary],ID from (select [Salary], ROW_NUMBER() over
(order by Employee.SALARY desc)RowNum from [Employee])e
where e.RowNum=2
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How many types of database relationship in sql server?
What are the types of ssrs?
How to create an index on an existing table in ms sql server?
Name 3 of the features that the sql server built-in function loginproperty performs on standard logins? : sql server security
What are the new features of sql server 2012 reporting service?
hi i am working as a testengineer , so i want to no the backend data base connection can any one tell mwe in detail
What is default port number for sql server 2000?
How do you delete a trigger?
What is for xml in sql server?
What is the difference between row_number and dense_rank?
What are acid properties of transaction?
How do you set a trace flag in sql server?
What is partitioned view?
What is the web service used for reporting services?
How do you troubleshoot errors in a SQL Server Agent Job?