How to Find Nth Highest Salary in SQL Server
A payroll analyst at a mid-size staffing company once sent me a screenshot of a report. It showed the “third highest salary” in a department, and the number was wrong. Two people shared the top salary, and the query counted them as separate ranks. The report fed a compensation review, so a small logic bug … Read more