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


Please Help Members By Posting Answers For Below Questions

How to list all stored procedures in the current database using ms sql server?

721


What is service broker?

684


What is difference between clustered index and non clustered index?

714


What is the difference between upgrade and migration in sql server?

681


What is normalization? Describe its different types.

673






Why normalization is used?

635


What is the Difference Between Primary and Foreign Key?

665


Explain Reporting Life Cycle?

94


How to replace the Query Result 'Null Value' with a text ?

665


Find columns used in stored procedure?

613


What is dbcc?

809


What is the difference between varchar and varchar(max) datatypes?

662


What is database dimension? : sql server analysis services, ssas

713


What is rolap and its advantage? : sql server analysis services, ssas

749


Explain about Joins?

686