Monday, 26 October 2015

How to find second highest salary in SQL using MAX?


Table Name : SalaryDetails

IDSalary
11000
2500
3750
4500
5350
6750

                Select max(salary) as salary from salaryDetails where salary not in (select top (1) salary from salaryDetails order by salary desc)

No comments:

Post a Comment