SELECT A2.EMPLID , A2.EMPL_RCD , A2.PRD_END_DT ,P2.PIN_NUM , P2.CALC_RSLT_VAL FROM PS_GP_PYE_PRC_STAT A2 , PS_GP_PYE_SEG_STAT B2 , PS_GP_RSLT_ACUM P2 WHERE B2.CAL_RUN_ID=A2.CAL_RUN_ID AND B2.EMPLID=A2.EMPLID AND B2.EMPL_RCD=A2.EMPL_RCD AND B2.GP_PAYGROUP=A2.GP_PAYGROUP AND B2.CAL_ID=A2.CAL_ID AND B2.ORIG_CAL_RUN_ID=A2.ORIG_CAL_RUN_ID AND B2.PYE_CALC_STAT>='50' AND B2.CALC_ACTION='C' AND P2.CAL_RUN_ID=A2.CAL_RUN_ID AND P2.EMPLID=A2.EMPLID AND P2.EMPL_RCD=A2.EMPL_RCD AND P2.GP_PAYGROUP=A2.GP_PAYGROUP AND P2.CAL_ID=A2.CAL_ID AND P2.ORIG_CAL_RUN_ID=A2.ORIG_CAL_RUN_ID AND P2.RSLT_SEG_NUM=B2.RSLT_SEG_NUM AND A2.RSLT_VER_NUM= ( SELECT MAX(V2.RSLT_VER_NUM) FROM PS_GP_PYE_PRC_STAT V2 WHERE V2.EMPLID=A2.EMPLID AND V2.EMPL_RCD=A2.EMPL_RCD AND V2.PRC_ORD_TS=A2.PRC_ORD_TS AND V2.COUNTRY=A2.COUNTRY) AND A2.RSLT_REV_NUM=1 AND P2.PIN_NUM IN ( SELECT DISTINCT B.PIN_NUM FROM PS_GP_PIN B WHERE B.COUNTRY = 'FRA' AND B.PIN_CATEGORY = 'AF')
|