SELECT HDR.EP_APPRAISAL_ID , JOB. EMPLID , JOB.SETID_JOBCODE , JOB.EFFDT , JOB.JOBCODE , C.DESCR FROM PS_EP_APPR_DTL_VW HDR , PS_JOB JOB , PS_JOBCODE_TBL C WHERE JOB.EMPLID = HDR.EMPLID AND JOB.EMPL_RCD = HDR.EMPL_RCD AND JOB.SETID_JOBCODE = C.SETID AND JOB.JOBCODE = C.JOBCODE AND C.EFF_STATUS = 'A' AND %EffdtCheck(JOBCODE_TBL, C, HDR.PERIOD_END_DT) AND JOB.EFFDT = ( SELECT MAX(EFFDT) FROM PS_JOB JOB2 WHERE JOB.EMPLID = JOB2.EMPLID AND JOB.EMPL_RCD = JOB2.EMPL_RCD AND JOB2.EFFDT <= HDR.PERIOD_END_DT) AND JOB.EFFSEQ = ( SELECT MAX(EFFSEQ) FROM PS_JOB WHERE EMPLID = JOB.EMPLID AND EMPL_RCD = JOB.EMPL_RCD AND EFFDT = JOB.EFFDT)
|