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 / bennison terry
Select Top 1 * from Tbl_Salary where ID not in (Select top 1 ID from tbl_salary order by salary desc) order by Id desc
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is self contained scalar sub query?
What is the federation in sql azure?
What is attribute relationships, why we need it? : sql server analysis services, ssas
How to use "if ... Else if ... Else ..." Statement structures in ms sql server?
What is analysis service repository?
Explain about integration services of Microsoft SQL server?
What is forward - only cursors / read only cursor?
What is difference between getdate and sysdatetime in sql server 2008?
how do you test proper tcp/ip configuration windows machine? : Sql server database administration
Why union all is faster than union?
Define tool Manage Statistics in SQL Server 2000 query ?
What do you understand by a view? What does the with check option clause for a view do?
Explain different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?
What are clustered and non-clustered index?
What it means to be triggered?