SELECT A.EMPLID , A.EMPL_RCD , JC.LANGUAGE_CD , JC.DESCRSHORT , D.DESCRSHORT FROM PS_JOB A , PS_JOBCODE_LANG JC , PS_DEPT_TBL_LANG D WHERE A.EFFDT= ( SELECT MAX(A2.EFFDT) FROM PS_JOB A2 WHERE A.EMPLID=A2.EMPLID AND A.EMPL_RCD=A2.EMPL_RCD AND A2.EFFDT<=%CurrentDateIn ) AND A.EFFSEQ= ( SELECT MAX(A3.EFFSEQ) FROM PS_JOB A3 WHERE A.EMPLID=A3.EMPLID AND A.EMPL_RCD=A3.EMPL_RCD AND A.EFFDT=A3.EFFDT ) AND JC.SETID = A.SETID_JOBCODE AND JC.JOBCODE = A.JOBCODE AND JC.EFFDT =( SELECT MAX(JC2.EFFDT) FROM PS_JOBCODE_TBL JC2 WHERE JC2.SETID=JC.SETID AND JC2.JOBCODE=JC.JOBCODE AND JC2.EFFDT<=A.EFFDT ) AND D.SETID = A.SETID_DEPT AND D.DEPTID = A.DEPTID AND D.EFFDT =( SELECT MAX(D2.EFFDT) FROM PS_DEPT_TBL D2 WHERE D2.SETID=D.SETID AND D2.DEPTID=D.DEPTID AND D2.EFFDT<=A.EFFDT )
|