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
What are the hotfixes and patches in sql server?
How to find the source of a table in sql server?
how would you write a sql query to compute a frequency table of a certain attribute involving two joins? What changes would you need to make if you want to order by or group by some attribute? What would you do to account for nulls?
Tell me what are the advantages of using stored procedures?
What are the recovery models for a database?
How to create nested stored procedure?
What is the process of normalising?
Detail about the hardware which is supported by SQL server?
What is SQL Azure Federations?
What is unique key constraint?
Differentiate between SQL and ORACLE joins and write their syntax.
What is the difference between a fill factor of 100 and 0?
Tell me about the approaches which you used to counter the DI problems.
Will sql server 2005 allow you to reduce the size of a column?
What is database replication? What are the different types of replication you can set up in sql server?