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 are the extra roles available in msdb? : sql server security
What is statement level trigger?
How can you stop stored procedures from recompiling?
How can you transfer data from a text file to a database table? Or how can you export data from a table to a comma delimited (csv) file? Or how can you import data from ms access to a table in a database? Or how can you export data from a table to an excel file?
What is the difference between a function and a trigger?
How to turn off warning messages during php execution?
Retrieve the unique rows from table without using UNIQUE and DISTINCT keywords.
How do I trace a query in sql server?
Give a example to search fr a string in all stored procedure in sql server.
What are the differences between DDL, DML and DCL in SQL?
What are the advantages of policy management?
What the different topologies in which replication can be configured?
What is b tree index?
What command do we use to rename a database?
What is the purpose of the tempdb database?