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 is meant by indexing?
Explain having clause?
What are the different subsets of sql?
What is the ‘fillfactor’?
Please illustrate physical database architecture? : SQL Server Architecture
What does it mean if @@cursor_row returns a negative number?
How to list all dsn entries on your local machine using odbc_data_source()?
How to create a store procedure with encryption?
What is indexing explain it with an example?
How to set a database state to offline in ms sql server?
How can you append an identity column to a temporary table?
Do you know what is user defined datatypes and when you should go for them?
What is a mutating table error and how can you get around it?
How is a full-text index updated?
What is encryption key?