SELECT DISTINCT C.BUSINESS_UNIT , C.EMPLID , C.EMPL_RCD_NUM , C.PC_JOBCODE , D.LANGUAGE_CD , D.DESCR50 FROM PS_PC_JOBCODE_TBL A , PS_SET_CNTRL_REC B , PS_PC_JOB C , PS_PC_JOBCODE_LANG D WHERE C.EFF_STATUS = 'A' AND C.EFFDT = ( SELECT MAX (C1.EFFDT) FROM PS_PC_JOB C1 WHERE C1.BUSINESS_UNIT = C.BUSINESS_UNIT AND C1.EMPLID = C.EMPLID AND C1.EMPL_RCD_NUM = C.EMPL_RCD_NUM AND C1.PC_JOBCODE = C.PC_JOBCODE AND C1.EFFDT <= %CurrentDateIn) AND C.EFFSEQ = ( SELECT MAX(EFFSEQ) FROM PS_PC_JOB C2 WHERE C2.BUSINESS_UNIT = C.BUSINESS_UNIT AND C2.EMPLID = C.EMPLID AND C2.EMPL_RCD_NUM = C.EMPL_RCD_NUM AND C2.PC_JOBCODE = C.PC_JOBCODE AND C2.EFFDT = C.EFFDT) AND A.PC_JOBCODE = C.PC_JOBCODE AND A.EFF_STATUS = 'A' AND A.EFFDT = ( SELECT MAX (A1.EFFDT) FROM PS_PC_JOBCODE_TBL A1 WHERE A1.SETID = A.SETID AND A1.PC_JOBCODE = A.PC_JOBCODE AND A1.EFFDT <= %CurrentDateIn) AND B.SETCNTRLVALUE = C.BUSINESS_UNIT AND B.RECNAME = 'PC_JOBCODE_TBL' AND A.SETID = B.SETID
|