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 / sudip mondal
select top 1 from employee where ID in (select top2 ID from
employee order by Salary desc) order by Salary asc
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain the working of sql privileges?
How to set database to be read_only in ms sql server?
How will you know when statistics on a table are obsolete?
What is the contrast amongst drop and truncate?
Explain trigger classes i.e. Instead of and after trigger?
let's assume you have data that resides on sql server 6.5. You have to move it sql server 7.0. How are you going to do it? : Sql server database administration
do you know how to configure db2 side of the application? : Sql server database administration
what is a correlated sub-query? : Sql server database administration
What is difference between equi join and inner join?
Suppose you want to implement the one-to-many relationships while designing tables. How would you do it?
How many types of triggers in sql server?
What to perform pattern match with the like operator?
Is there any difference between primary key and unique with the not null condition?
When is the use of update_statistics command?
What sql server means?