SQL – Second largest Salary from EMPLOYEE table

Top Nth row from a table can be got using :

SELECT TOP 1 salaryFROM (SELECT DISTINCT TOP n salaryFROM employeeORDER BY salary DESC) aORDER BY salary

Leave a Reply

Your email address will not be published. Required fields are marked *