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 can you know if the row fetched from cursor is still valid in underlying table?
How to delete a login name in ms sql server?
What are the purpose of Normalisation?
How to create a scrollable cursor with the scroll option?
How to transfer an existing table from one schema to another schema in ms sql server?
you accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover? : Sql server administration
How to rename an existing column with sql server management studio?
What is user defined datatypes and when you should go for them?
What is the difference between inner join and equi join?
What is cursor in ms sql server?
What is a trigger? Why we need it?
What is an example of a primary key?
How to create nested stored procedure?
Do you know what are acid properties of transaction?
Explain what is raid and what are different types of raid levels?