[BTW: there is no such address as dbi-users-help, please trim it from your cc list]
This works with DBD::CSV and a table "t" that has two columns - "name" and "amount":Alternatively, you could accomplish the same effects as a GROUP BY by using several combined queries and/or some perl manipulation.I would appreciate if you or someone else can point out how to accomplish "group by" with several combined queries that are supported by CSV. Note: only sql querieswith minimum (best no) perl manipulation.
my $sth=$dbh->prepare(
'SELECT MAX(amount),AVG(amount) FROM t WHERE name=?'
);
my $names = $dbh->selectcol_arrayref(
'SELECT DISTINCT name FROM t'
);
for my $name(@$names) {
$sth->execute($name);
while (my $r=$sth->fetch) {
print "$name @$r\n";
}
}
--
Jeff
