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 / deepa
drop table #temp
select top 2 identity(int,1,1) as SlNo, *
into #temp from employee order by salary desc
select * from #temp where SlNo = 2
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Can you explain the disadvantages/limitation of the cursor?
What is ems sql management studio? : sql server management studio
Difference between DELETE and TRUNCATE?
Which is faster statement or preparedstatement?
How do I connect to sql server database?
What are xml indexes?
Explain what are partitioned views and distributed partitioned views?
How many clustered indexes there can be on table ?
How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?
How to make a remote connection in a database?
How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?
What is the Main Difference between ACCESS and SQL SERVER?
What is onf in normalization form?
What is dimension table? : sql server analysis services, ssas
How to Check if table exists in sql server?