SELECT A.LM_PERSON_ID , A.LM_HR_EMPLID , D.FIRST_NAME_SRCH , D.LAST_NAME_SRCH , D.LM_NAME_DISPLAY , E.LM_EMAIL_ADDR , F.LM_PHONE FROM PS_LM_PERSON A , PS_LM_CURR_JOB_VW B , PS_LM_PERSON_NAME D , PS_LM_PERSON_EMAIL E , PS_LM_PERSON_PHONE F WHERE B.LM_PERSON_ID = A.LM_PERSON_ID AND B.LM_ACTIVE = 'Y' AND A.LM_EXT_PERSON_FLG = 'N' AND F.LM_PERSON_ID = A.LM_PERSON_ID AND F.LM_PRIMARY = 'Y' AND E.LM_PERSON_ID = A.LM_PERSON_ID AND E.LM_PRIMARY = 'Y' AND %CurrentDateIn BETWEEN B.EFFDT AND B.LM_END_EFFDT AND D.LM_PERSON_ID = A.LM_PERSON_ID AND D.LM_DISPLAY_FLAG = 'Y' AND %CurrentDateIn BETWEEN D.EFFDT AND D.LM_END_EFFDT AND ((D.LM_NAME_TYPE = 'PRF') OR (D.LM_NAME_TYPE = 'PRI' AND NOT EXISTS ( SELECT LM_NAME_TYPE FROM PS_LM_PERSON_NAME WHERE LM_PERSON_ID = D.LM_PERSON_ID AND LM_NAME_TYPE = 'PRF' AND %CurrentDateIn BETWEEN EFFDT AND LM_END_EFFDT)))
|