in reply to Group by from array
If you already feel comfortable with SQL, you can also use an SQLite virtual table to treat your Perl data:
our $aref = $result_set; $dbh->do(<<''); CREATE VIRTUAL TABLE my_table USING perl(Account, Entity ,Unit, arrayrefs="main::aref") my $elements = $dbh->selectall_arrayref(<<'SQL', undef, {}); SELECT Account, Entity, Unit, SUM(Jan) Jan, SUM(Feb) Feb, SUM(Mar) Mar FROM my_table GROUP BY Account, Entity, Unit; SQL ...
|
|---|