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 is the function of sql server agent windows service?
What is a filestream?
Does sql server use java?
Write a SQL query to make a column as unique?
Tell me what is normalization? Explain different forms of normalization?
Why we need sql server?
When is update_statistics command used?
Why do you want to join software field as you have done your BE in Electronics?
Explain in details security in SQL azure?
How to list all user names in a database?
Do you know how to send email from database?
How will you know when statistics on a table are obsolete?
How to convert numeric expression data types by assignment operations?
What is log shipping? Can we do logshipping with SQL Server 7.0 - Logshipping is a new feature of SQL Server 2000. We should have two SQL Server - Enterprise Editions. From Enterprise Manager we can configure the logshipping. In logshipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and we can use this as the DR (disaster recovery) plan.
Why use “pivot” in sql server?