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 RAID? What are the different types of RAID configurations?
What is logon trigger?
What does <> symbol mean?
Define candidate key, alternate key, and composite key.
What is provisioning, billing and metering, and connection routing concepts in the service layer?
What are key constraints?
How to select some specific columns from a table in a query in ms sql server?
What are locks in sql?
Why are sql functions used?
Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?
Difference between connected and disconnected database in .net with sql server?
how to create “alternate row colour”?
How to create sub reports?
Explain about sql server login?
How to update a field in SQL after ALTERING a row?