b1nary0mega
2/17/2015 - 5:56 PM

Pull all Highland Hospital Employees with a Masters Degree where the major (listed) was some form of education. All Highland Employees have

Pull all Highland Hospital Employees with a Masters Degree where the major (listed) was some form of education. All Highland Employees have an employee id that is between 2 and 5 digits long (Strong utilizes 6).

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;