http://www.perlmonks.org?node_id=881568


in reply to Re: hoh or hoa data structure
in thread hoh or hoa data structure

SELECT null, e_id, Cus, ta, gd1, gd2 FROM tabla1 t union all select 'Total', e_id, Cus, ta, sum(gd1), SUM(gd2) from tabla1 group by + e_id,Cus, ta order by e_id,Cus, ta;