HD Supply's workforce reporting team needs a compensation view across active employees, departments, and work locations. Write a PostgreSQL query to identify every active employee tied at the third-highest distinct current salary as of January 1, 2025.
Requirements
- Select each employee's latest salary record effective on or before the reporting date.
- Join employees to departments and locations, excluding rows without valid matches.
- Exclude inactive employees.
- Rank distinct salary values from highest to lowest and return all employees at rank 3.
- Return employee name, department, city, salary, and salary rank, ordered by employee name.