SELECT DISTINCT IC.CERTIFICATION,
MC.CRED_NAME
FROM IER_CERTIFICATIONS IC
JOIN IER_MAGNET_CERT MC
ON IC.CERTIFICATION = MC.CREDENTIAL
WHERE IC.FACILITY = 'SMH'
AND ( IC.EXP_DATE >= '01-JAN-2014'
AND IC.EXP_DATE <= '01-JAN-2030' -- due to folks entering in certifications too far in advance
)
AND ( IC.CERT_TITLE NOT LIKE 'Verified%by%'
OR (IC.CERTIFICATION != 'NA'
AND IC.CERT_TITLE != 'NA'
AND IC.CERT_BODY != 'NA' ) )
AND IC.CERTIFICATION != '<I>Not provided</I>'
AND IC.CERTIFICATION IN
( SELECT DISTINCT CREDENTIAL FROM IER_MAGNET_CERT
)
AND IC.CERTIFICATION NOT IN
( SELECT DISTINCT MAGNET_CNS_CERTS.CREDENTIAL FROM MAGNET_CNS_CERTS
)
ORDER BY IC.CERTIFICATION;