SELECT J.EMPLID , J.EMPL_RCD , BU.DESCR , C.DESCR , D.DESCR FROM PS_HR_OBD_TRIGGER T , PS_JOB J , PS_COMPANY_TBL C , PS_DEPT_TBL D , PS_BUS_UNIT_TBL_HR BU WHERE J.EMPLID = T.EMPLID AND J.EMPL_RCD = T.EMPL_RCD AND J.EFFDT = ( SELECT MAX(EFFDT) FROM PS_JOB J1 WHERE J1.EMPLID=J.EMPLID AND J1.EMPL_RCD=J.EMPL_RCD AND EFFDT <= %CurrentDateIn ) AND J.EFFSEQ = ( SELECT MAX(EFFSEQ) FROM PS_JOB J1 WHERE J1.EMPLID=J.EMPLID AND J1.EMPL_RCD=J.EMPL_RCD AND J1.EFFDT=J.EFFDT) AND D.SETID = J.SETID_DEPT AND D.DEPTID = J.DEPTID AND D.EFFDT = ( SELECT MAX(EFFDT) FROM PS_DEPT_TBL D1 WHERE D1.SETID = D.SETID AND D1.DEPTID = D.DEPTID AND D1.EFFDT <= %CurrentDateIn) AND C.COMPANY = J.COMPANY AND C.EFFDT = ( SELECT MAX(EFFDT) FROM PS_COMPANY_TBL C1 WHERE C1.COMPANY = C.COMPANY AND C1.EFFDT <= %CurrentDateIn) AND BU.BUSINESS_UNIT = J.BUSINESS_UNIT
|