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
Is resultset an interface?
Explain primary key?
Why variables called the most powerful component of ssis?
How to access the deleted record of an event?
How to count rows with the count(*) function in ms sql server?
Can we create clustered index on composite key?
write an SQL query to list the employees who joined in the month of January?
What is nolock hint in sql server 2008
What is the minimum recommended amount of ram for sql server 2012 enterprise?
How to get the definition of a stored procedure back?
Types of Authentications in Sql Server? How user gets authenticated through windows authentication?
Tell me what is the significance of null value and why should we avoid permitting null values?
Explain the difference between clustered and non-clustered index?
Do you know what are the properties of the relational tables?
What do you mean by normalisation?