select e_id,cus, sum(gd1) as g1, sum(gd2) as g2 from test group by e_id,cus,ta;