my $sth = $dbh->prepare('SELECT DISTINCT surveys, COUNT(*) FROM neverland GROUP BY surveys ORDER BY surveys DESC'); $sth->execute() or die $sth->errstr; while (my @result = $sth->fetchrow_array()) { my $percent = (@result[1] / $nothernumber)*100; printf qq(