SELECT APP.HRS_PERSON_ID , PROF.HRS_PROFILE_SEQ , NM.LANGUAGE_CD , NM.NAME_DISPLAY FROM PS_HRS_APPLICANT APP LEFT OUTER JOIN PS_HRS_APP_ADDR_I AD ON APP.HRS_PERSON_ID = AD.HRS_PERSON_ID , PS_HRS_APP_PROFILE PROF LEFT OUTER JOIN PS_HRS_APPINDX_CTL AI ON (PROF.HRS_PERSON_ID = AI.HRS_PERSON_ID AND PROF.HRS_PROFILE_SEQ = AI.HRS_PROFILE_SEQ) , PS_HRS_APP_NM_LNG NM , PS_HRS_RCMNT R WHERE APP.HRS_PERSON_ID = PROF.HRS_PERSON_ID AND APP.HRS_PERSON_ID = NM.HRS_PERSON_ID AND (APP.STATUS_CODE IN ( SELECT STATUS_CODE FROM PS_HRS_SRCHIDX_APS APS WHERE APS.HRS_SRCH_INDEX_CD = 'A') OR NOT EXISTS ( SELECT 1 FROM PS_HRS_SRCHIDX_APS APS WHERE APS.HRS_SRCH_INDEX_CD = 'A')) AND APP.HRS_PERSON_ID = R.HRS_PERSON_ID AND R.HRS_RCMNT_ID = ( SELECT MAX(R2.HRS_RCMNT_ID) FROM PS_HRS_RCMNT R2 WHERE R2.HRS_PERSON_ID = R.HRS_PERSON_ID) AND R.HRS_LOGICAL_DELETE = 'N'
|