select branch, BSP_FROM, BSP_TO, sum(EXCH_GAIN) EXCH_GAIN
from ke014t3.bsp_exch_gains
group by branch, BSP_FROM, BSP_TO
order by branch, BSP_FROM, BSP_TO

select branch, CUST_NAME, CUST_CODE, sum(EXCH_GAIN) EXCH_GAIN
from ke014t3.bsp_exch_gains
group by branch, CUST_CODE, CUST_NAME
order by branch, CUST_CODE, CUST_NAME

select branch, TC, TC_NAME, sum(EXCH_GAIN) EXCH_GAIN
from ke014t3.bsp_exch_gains
group by branch, TC, TC_NAME
order by branch, TC, TC_NAME
