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
Explain contrast amongst grouped and non-bunched records?
How do you create type- insensitive operator?
In what sequence sql statement is processed?
What are different types of subquery?
What does sql server mean?
What is report rendering ?
How do you rename a table in sql server?
what is the difference between delete table and truncate table commands? : Sql server database administration
Tell me what is the order in which the sql query is executed?
What are the two modes of authentication in sql server?
How to delete existing triggers using "drop trigger"?
Using the customer, and order table in northwind database, please write a query to produce xml?
Is there any difference between primary key and unique with the not null condition?
What is exporting and importing utility?
What do you understand by integration services in sql server?