SELECT SCR.SETID , J.JOBCODE , JCT.LANGUAGE_CD , JCT.DESCR , J.EMPLID , J.EMPL_RCD , PD.NAME FROM PS_JOB J , PS_JOBCODE_LANG JCT , PS_PERSONAL_DATA PD , PS_SET_CNTRL_REC SCR WHERE J.BUSINESS_UNIT = SCR.SETCNTRLVALUE AND SCR.RECNAME = 'JOBCODE_TBL' AND JCT.SETID = SCR.SETID AND JCT.JOBCODE = J.JOBCODE AND JCT.EFFDT = ( SELECT MAX(EFFDT) FROM PS_JOBCODE_TBL JCT2 WHERE JCT.SETID = JCT2.SETID AND JCT.JOBCODE = JCT2.JOBCODE AND JCT2.EFF_STATUS = 'A' AND JCT2.EFFDT <= %CurrentDateIn ) AND J.EFFDT = ( SELECT MAX(EFFDT) FROM PS_JOB J2 WHERE J.EMPLID = J2.EMPLID AND J.EMPL_RCD = J2.EMPL_RCD AND J2.EFFDT <= %CurrentDateIn ) AND J.EFFSEQ = ( SELECT MAX(EFFSEQ) FROM PS_JOB J3 WHERE J.EMPLID = J3.EMPLID AND J.EMPL_RCD = J3.EMPL_RCD AND J.EFFDT <= J3.EFFDT ) AND J.EMPLID = PD.EMPLID AND J.EMPL_STATUS = 'A'
|