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 / radhakrishnan vaithilingam
SELECT TOP 1 id.salary
FROM (SELECT TOP 2 id,salary
FROM employee
ORDER BY salary DESC )a
ORDER BY a.salary ASC
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is replication with database mirroring? : sql server database administration
What are the authentication modes in sql server? How can it be changed?
What are the 7 disadvantages to a manual system?
Can you explain what are various ways to enhance the ssrs report?
What is the synonym of join?
Why I have to use stored procedures?
What do you mean by SQL injection attack?
Does sql server use t sql?
What is triggers in ms sql server?
How do I clean up sql server transaction log?
What is schemabinding a view?
How is sql server used?
What are the advantages of using cte?
How to resolve the orphan use problem? : sql server security
What is sql server database?