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 / lekhrajdeshmukh
select top 1 id,salary from(select top 2 id,salary from
employee group by id,salary order by salary desc)a order by
salary asc
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Data table as parameter in sql server?
What is a cache in ssrs?
What is Federation and Federation Member?
What is exporting and importing utility?
what is a join and explain different types of joins? : Sql server database administration
Detail about the hardware which is supported by SQL server?
Difference between uniqe index and uniqe constraint?
What are views used for?
What do you understand by triggers and mention the different types of it?
Explain few examples of stored procedure over triggers?
What is measure group, measure? : sql server analysis services, ssas
What is the difference between having clause and where clause in sql server?
Which tcp/ip port does the sql server run on? How can it be changed?
What are dml (data manipulation language) statements in ms sql server?
What are the different types of normalization?