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.department_name, then second_highest_salary.department_name in ascending order.salary is NULL.salary values without rounding or numeric conversion.| 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 |