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
Explain about protocol layer present in SQL server?
Where are stored procedures in sql server?
What is difference between views and stored procedures?
What is it unwise to create wide clustered index keys?
What's the information that can be stored inside a bit column?
What is for xml in sql server?
What are the tool windows in sql server management studio? : sql server management studio
Is truncate a dml command?
What is the difference between executequery () and executeupdate ()?
What is statement level trigger?
How do I clean up sql server transaction log?
How to create an index on an existing table in ms sql server?
What are sql server procedures?
How do I uninstall sql server 2014?
What is the difference between dropping a database and taking a database offline?