For each row, COALESCE returns the first nonmissing value of either P2.SALARY or P.SALARY. Because P2.SALARY is the first argument, if there is a nonmissing value for P2.SALARY, COALESCE returns that value. Thus, the output contains the most recent salary information for every employee.
          coalesce(p2.salary,p.salary) label='Current Salary'
                  format=dollar8.