SELECT DISTINCT A.EMPLID , A.CAL_RUN_ID , A.EMPL_RCD , C.PIN_NUM , A.ACM_FROM_DT , A.ACM_THRU_DT , A.PIN_PARENT_NUM , E.DESCR , A.CALC_RSLT_VAL FROM PS_GP_RSLT_ACUM A , PS_GP_PYE_PRC_STAT B , PS_GP_ABS_TK_FCST C , PS_GP_PIN D , PS_GP_PIN E WHERE A. EMPLID = B.EMPLID AND A.CAL_RUN_ID = B.CAL_RUN_ID AND A.EMPL_RCD = B.EMPL_RCD AND A.GP_PAYGROUP = B.GP_PAYGROUP AND A.CAL_ID = B.CAL_ID AND A.ORIG_CAL_RUN_ID = B.ORIG_CAL_RUN_ID AND A.ORIG_CAL_RUN_ID = A.CAL_RUN_ID AND B.CALC_TYPE = 'A' AND A.EMPL_RCD_ACUM = A.EMPL_RCD AND A.PIN_NUM = C.PIN_FCST_RSLT_NUM AND C.PIN_FCST_RSLT_NUM = D.PIN_NUM AND D.PIN_TYPE = 'AC' AND B.PRC_ORD_TS = ( SELECT MAX(PRC_ORD_TS) FROM PS_GP_PYE_PRC_STAT ST WHERE A. EMPLID = ST.EMPLID AND A.CAL_RUN_ID = ST.CAL_RUN_ID AND A.EMPL_RCD = ST.EMPL_RCD AND A.GP_PAYGROUP = ST.GP_PAYGROUP AND A.ORIG_CAL_RUN_ID = ST.ORIG_CAL_RUN_ID AND ST.CALC_TYPE = 'A') AND E.PIN_NUM = A.PIN_PARENT_NUM AND A.RSLT_SEG_NUM = ( SELECT MAX(A1.RSLT_SEG_NUM) FROM PS_GP_RSLT_ACUM A1 WHERE A.EMPLID = A1.EMPLID AND A.EMPL_RCD = A1.EMPL_RCD AND A.CAL_ID = A1.CAL_ID AND A.CAL_RUN_ID = A1.CAL_RUN_ID AND A.ORIG_CAL_RUN_ID = A1.ORIG_CAL_RUN_ID AND A.PIN_NUM = A1.PIN_NUM)
|