SELECT JOB.EMPLID ,JOB.EMPL_RCD ,JOB.EFFDT ,JC.BA_CD ,JC.JOBCODE ,JC.DESCR FROM PS_JOBCODE_TBL JC , PS_JOB JOB WHERE JOB.REG_REGION = 'DEU' AND JOB.EFFSEQ = ( SELECT MAX(J1.EFFSEQ) FROM PS_JOB J1 WHERE J1.EMPLID = JOB.EMPLID AND J1.EMPL_RCD = JOB.EMPL_RCD AND J1.EFFDT = JOB.EFFDT ) AND JOB.JOBCODE = JC.JOBCODE AND JOB.SETID_JOBCODE = JC.SETID AND JC.EFFDT = ( SELECT MAX(JC1.EFFDT) FROM PS_JOBCODE_TBL JC1 WHERE JC1.JOBCODE = JC.JOBCODE AND JC1.SETID = JC.SETID AND JC1.EFFDT <= JOB.EFFDT ) AND JC.EFF_STATUS <> 'I'
|