SELECT A.INSTITUTION , A.EMPLID , SUM(A.EXPT_MTCH_AMT) FROM PS_AV_MTCH_GIFT A , PS_AV_GIFT_DTL B , PS_AV_SESSION_TBL C , PS_AV_GIFT_DTL B1 , PS_AV_SESSION_TBL C1 WHERE A.INSTITUTION = B.INSTITUTION AND A.MTCH_SESSION_NO = B.SESSION_NO AND A.MTCH_GIFT_NO = B.GIFT_NO AND B.ADJUSTMENT_FLG = 'N' AND A.INSTITUTION = C.INSTITUTION AND A.MTCH_SESSION_NO = C.SESSION_NO AND A.INSTITUTION = B1.INSTITUTION AND A.SESSION_NO = B1.SESSION_NO AND A.GIFT_NO = B1.GIFT_NO AND B1.ADJUSTMENT_FLG = 'N' AND A.INSTITUTION = C1.INSTITUTION AND A.SESSION_NO = C1.SESSION_NO AND (C.SESS_STATUS <> 'P' ) GROUP BY A.INSTITUTION , A.EMPLID
|