WITH CTE AS( SELECT EmpID, EmpName, EmpSalary, RN = ROW_NUMBER() OVER (ORDER BY EmpSalary DESC) FROM dbo.Salary)SELECT EmpID, EmpName, EmpSalaryFROM CTEWHERE RN = @NthRow
Use of CTE recomended as it helps in performance of the query.
Learn MS SQL from the Best Tutors
The best tutors for MS SQL Classes are on UrbanPro
The best Tutors for MS SQL Classes are on UrbanPro