SELECT DISTINCT A.EMPLID , A.EMPL_RCD , B2.LANGUAGE_CD , B2.DESCR , C2.DESCR , A.COMPANY FROM PS_JOB A , PS_DEPT_TBL B , PS_DEPT_TBL_LANG B2 , PS_JOBCODE_TBL C , PS_JOBCODE_LANG C2 WHERE A.EFFDT=( SELECT MAX(EFFDT) FROM PS_JOB JOB WHERE JOB.EMPLID=A.EMPLID AND JOB.EMPL_RCD=A.EMPL_RCD AND JOB.EFFDT<=%CurrentDateIn) AND EFFSEQ = ( SELECT MAX(EFFSEQ) FROM PS_JOB WHERE EMPLID = A.EMPLID AND EMPL_RCD = A.EMPL_RCD AND EFFDT = A.EFFDT) AND A.SETID_JOBCODE = C.SETID AND A.JOBCODE = C.JOBCODE AND %EffdtCheck(JOBCODE_TBL, C, %CurrentDateIn) AND A.SETID_DEPT = B.SETID AND A.DEPTID = B.DEPTID AND %EffdtCheck(DEPT_TBL, B, %CurrentDateIn) AND B.SETID = B2.SETID AND B.DEPTID = B2.DEPTID AND B.EFFDT = B2.EFFDT AND C.SETID = C2.SETID AND C.JOBCODE = C2.JOBCODE AND C.EFFDT = C2.EFFDT AND C2.LANGUAGE_CD = B2.LANGUAGE_CD
|