AvidXchange wants to review compensation bands by department. Write a PostgreSQL query to find the second highest distinct salary in each department, without using any aggregate functions such as MAX() or COUNT().
department_name.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Primary key for the employee |
| employee_name | VARCHAR(100) | Employee name |
| department_name | VARCHAR(100) | Department name |
| salary | INT | Employee salary, may repeat across employees |
| hire_date | DATE | Employee hire date |