in reply to Processing DBI query results

Expanding a little on RMGir's post - you could conditionally build the SQL statement depending on the options selected and do all of the calculations/aggregates there.

eg

$sql = "select "; $joiner = " "; foreach (@enable_opts) { $sql .= $joiner . $_ . "(column)"; $joiner = ","; } $sql .= " from table where column = ?"; #etc

rdfield