SELECT A.EMPLID , A.EMPL_RCD , A.EFFDT , A.EFFSEQ , A.EFFDT FROM PS_JOB A WHERE A.HR_STATUS = 'A' AND A.EFFDT = ( SELECT MAX(A_ED.EFFDT) FROM PS_JOB A_ED WHERE A.EMPLID = A_ED.EMPLID AND A.EMPL_RCD = A_ED.EMPL_RCD AND (A_ED.ACTION IN ('ADD','ADL','PAY','HIR', 'REH') OR A_ED.CHANGE_PCT <> 0)) AND A.EFFSEQ = ( SELECT MAX(A_ES.EFFSEQ) FROM PS_JOB A_ES WHERE A.EMPLID = A_ES.EMPLID AND A.EMPL_RCD = A_ES.EMPL_RCD AND A.EFFDT = A_ES.EFFDT AND (A_ES.ACTION IN ('ADD','ADL','PAY','HIR', 'REH') OR A_ES.CHANGE_PCT <> 0) )
|