SELECT DISTINCT A.EMPLID FROM PS_PER_ORG_ASG_INT A , PS_JOB B , PS_INSTALL_INTEGR C WHERE C.INT_APP_TYPE = 'SCH' AND C.INTEGR_PROD_CD = 'OWS' AND C.INSTALLED_FLAG = 'Y' AND A.INT_APP_TYPE = C.INT_APP_TYPE AND A.INTEGR_PROD_CD = C.INTEGR_PROD_CD AND A.ENROLLED_FLAG = 'Y' AND B.EMPLID = A.EMPLID AND B.EMPL_RCD = A.EMPL_RCD AND B.HR_STATUS = 'A' AND B.EFFDT = ( SELECT MAX(B1.EFFDT) FROM PS_JOB B1 WHERE B1.EMPLID = B.EMPLID AND B1.EMPL_RCD = B.EMPL_RCD AND B1.HR_STATUS = 'A') AND B.EFFSEQ = ( SELECT MAX (B2.EFFSEQ) FROM PS_JOB B2 WHERE B2.EMPLID = B.EMPLID AND B2.EMPL_RCD = B.EMPL_RCD AND B2.EFFDT = B.EFFDT AND B2.HR_STATUS = 'A')
|