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
How to insert and update data into a table with "insert" and "update" statements?
Can we use pragma autonomous_transaction in trigger?
What is candidate key with example?
How will you optimize a stored procedure optimization?
What is filter index?
Is it possible in sql table to have more than one foreign key?
What is ddl command?
Would you store your query in a ssrs report or a database server? State the reason why?
What are the two authentication modes in sql server?
how can you select rexcord(rows) from table A which is not present in Table B . Id being the FK in Table B referencing to ID Table A
How to Update from select query in sql server?
How to convert a table data in XML format in sql server?
Beginning with sql server version 7 0, a new enhanced data type nchar was added what type of data is supported with this data type?
What is meant by indexing?
What are the key configuration files for sql server reporting services ?