in reply to Re^2: Combine data in table
in thread Combine data in table
(Note that this is inefficient, as well -- would be better to use a $sth and fetch one row at a time instead of sucking in all the rows at once)my $rows = $dbh->selectall_arrayref("SELECT * FROM your_table", {Slice +=>{}}, ); my %ips; foreach my $row (@$rows){ $ips{ $row->{colIP} }->{ colPartitionSize } += $row->{colPartitionSi +ze}; $ips{ $row->{colIP} }->{ colPartitionFree } += $row->{colPartitionFr +ee}; } print Dumper \%ips;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Combine data in table
by DrAxeman (Scribe) on Aug 07, 2005 at 23:25 UTC | |
by davidrw (Prior) on Aug 08, 2005 at 01:19 UTC | |
|
Re^4: Combine data in table
by DrAxeman (Scribe) on Aug 07, 2005 at 19:10 UTC | |
by davidrw (Prior) on Aug 07, 2005 at 19:30 UTC | |
by DrAxeman (Scribe) on Aug 07, 2005 at 19:49 UTC | |
by davidrw (Prior) on Aug 07, 2005 at 20:19 UTC | |
by jZed (Prior) on Aug 08, 2005 at 02:52 UTC | |
by CountZero (Bishop) on Aug 07, 2005 at 20:30 UTC |