I am trying to fetch record from empMaster table for the nth highest Salary.But getting error near 'N' .
SELECT TOP 1 salary
FROM
(SELECT DISTINCT TOP n salary
FROM empMaster
ORDER BY salary DESC) AS temp
ORDER BY salary
Error message is:
Incorrect syntax near 'n'.