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 / sivanandam
SELECT ID,MAX(SALARY) FROM EMP
WHERE SALARY < SELECT MAX(SALARY) FROM EMP
| Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
What is difference between drop truncate and delete?
What do you mean by an execution plan? Why is it used?
How do you run a trace?
When would you use a before or after trigger?
tell me the disaster recovery plan
How many types of subqueries are there in sql server?
can we have a nested transaction? : Sql server database administration
Can sql servers linked to other servers like oracle?
How much space does sql server 2016 take?
What is the function of inner join?
Is it possible to update the views? If yes, how, if not, why?
What is sub query and its properties?
What are the differences between INNER JOIN, LEFT JOIN and RIGHT JOIN in SQL Server?
What stored by the master? : sql server database administration
How to create a local temporary stored procedure?