SELECT d.EMPLOYEE_ID,
TRIM(p.last_name) AS last_name,
TRIM(p.first_name) AS first_name,
d.DEGREE_TYPE,
d.NURSING AS NURSING_DEGREE,
d.MAJOR,
d.GRAD_YEAR,
d.COLLEGE,
d.DATE_MODIFIED AS DATE_ENTERED,
d.FACILITY,
d.ROW_ID
FROM IER_DEGREE d
JOIN
(SELECT DISTINCT employee_id,
TRIM(last_name) AS last_name,
TRIM(first_name) AS first_name
FROM employee_profile
WHERE regexp_like(employee_id, '^\d{2,5}$')
) p
ON d.employee_id = p.employee_id
WHERE facility ='HH'
AND Degree_type ='Masters Degree'
AND LOWER(major) LIKE '%education%'
ORDER BY P.LAST_NAME,
P.FIRST_NAME;