Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: hoh or hoa data structure

by ahmad (Hermit)
on Jan 11, 2011 at 00:38 UTC ( [id://881567]=note: print w/replies, xml ) Need Help??


in reply to hoh or hoa data structure

If your only reason is finding the sum of the 4th & 5th column ... then a simple sql query might do it for you.

Here's an example:

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

Replies are listed 'Best First'.
Re^2: hoh or hoa data structure
by Generoso (Prior) on Jan 11, 2011 at 00:41 UTC
    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;

      Thanks to all for the different answers. It works perfect.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://881567]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-03-29 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found