SELECT A.EMPLID ,A.EMPL_RCD ,A.CAL_ID ,A.GPBR_INS_DESC_VAL ,A.GPBR_13_COMPENSAT ,A.GPBR_INSURED_DISC ,A.GPBR_GPS_SOC_PROV FROM PS_GPBR_SEFIP_WA A , PS_GP_PYE_SEG_STAT B WHERE B.EMPLID = A.EMPLID AND B.EMPL_RCD = A.EMPL_RCD AND B.CAL_RUN_ID = A.CAL_RUN_ID AND B.GP_PAYGROUP = A.GP_PAYGROUP AND B.CAL_ID = A.CAL_ID AND B.ORIG_CAL_RUN_ID = A.ORIG_CAL_RUN_ID AND B.RSLT_SEG_NUM = A.RSLT_SEG_NUM AND B.RSLT_SEG_NUM = ( SELECT MIN(RSLT_SEG_NUM) FROM PS_GP_PYE_SEG_STAT WHERE EMPLID = B.EMPLID AND EMPL_RCD = B.EMPL_RCD AND CAL_RUN_ID = B.CAL_RUN_ID AND GP_PAYGROUP = B.GP_PAYGROUP AND CAL_ID = B.CAL_ID AND ORIG_CAL_RUN_ID = B.ORIG_CAL_RUN_ID) AND B.RSLT_VER_NUM = ( SELECT MAX(RSLT_VER_NUM) FROM PS_GP_PYE_SEG_STAT WHERE EMPLID = B.EMPLID AND EMPL_RCD = B.EMPL_RCD AND CAL_RUN_ID = B.CAL_RUN_ID AND GP_PAYGROUP = B.GP_PAYGROUP AND CAL_ID = B.CAL_ID AND ORIG_CAL_RUN_ID = B.ORIG_CAL_RUN_ID AND RSLT_SEG_NUM = B.RSLT_SEG_NUM) AND B.RSLT_REV_NUM = ( SELECT MAX(RSLT_REV_NUM) FROM PS_GP_PYE_SEG_STAT WHERE EMPLID = B.EMPLID AND EMPL_RCD = B.EMPL_RCD AND CAL_RUN_ID = B.CAL_RUN_ID AND GP_PAYGROUP = B.GP_PAYGROUP AND CAL_ID = B.CAL_ID AND ORIG_CAL_RUN_ID = B.ORIG_CAL_RUN_ID AND RSLT_SEG_NUM = B.RSLT_SEG_NUM AND RSLT_VER_NUM = B.RSLT_VER_NUM)
|