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 / elumalai.k
select top1 id,salary from employee
where
(salary<(select max (salary) As sal from employee As Empp))
orderby salary desc.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is standby servers? Explain types of standby servers.
How many database files are there in sql server 2000?what are they?
What is the difference between Triggers and Stored Procedure?
Explain the Ways to improve the performance of a sql azure database?
What are the steps to insert a table?
Explain different backup plans?
What is history table in sql server?
Explain the benefits of user-defined functions?
How you trouble shoot when any job fails
What are the different types of sub-queries?
Tell about MOM Tool(Microsoft Operator Manager)?
What do you mean by a Composite primary key?
Working with TLogs
How can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role?
How do I start sql server?