Straive uses department-level compensation reports to review salary distribution across teams supporting its content and data platforms. The report must identify employees whose salary is the third-highest distinct salary within their department.
Write a PostgreSQL query that returns every employee tied at the third-highest distinct salary in departments with at least three distinct salary levels.
employees to departments using department_id.| Column | Type | Description |
|---|---|---|
| department_idPK | INTEGER | Unique department identifier |
| department_name | VARCHAR(100) | Department name |
| Column | Type | Description |
|---|---|---|
| employee_idPK | INTEGER | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee full name |
| department_id | INTEGER | Department assigned to the employee |
| salary | NUMERIC(10,2) | Annual employee salary |