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
What are different types of raid levels?
Explain the stored procedure?
Explain the xml support sql server extends?
Who is the owner of a schema in ms sql server?
What are the restrictions applicable while creating views? : SQL Server Architecture
What is the difference between Normalization and De-normalization?
How can I create a report based on a query? : sql server management studio
What is precedence constraint?
Can select statements be used on views in ms sql server?
How you can add messages to the nt event log from within a stored procedure?
How many triggers are possible per table?
What are the advantages of using stored procedures?
Tell me about builtinadministrator?
What is the difference between sql server 2000 object owner and sql server 2005 schema? : sql server database administration
What are the main sources of data?