S&P Global needs a compensation validation query for employee records used in internal QA reporting. Write a PostgreSQL query to return the second distinct highest salary from the employees table without using analytical or window functions.
second_highest_salary.NULL salaries and return NULL if fewer than two distinct non-NULL salaries exist.RANK, DENSE_RANK, ROW_NUMBER, or other window functions.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee name |
| department | VARCHAR(50) | Organizational department |
| salary | NUMERIC(12,2) | Annual salary |