--- index.cgi 2009/04/13 20:23:55 3 +++ index.cgi 2009/04/13 22:12:38 5 @@ -90,7 +90,7 @@ if ( $group_by ) { @columns = ( "count($group_by)", $group_by ); my $g; - foreach my $c ( @where_parts, param('order_by'), $group_by ) { + foreach my $c ( @where_parts, $group_by ) { $c =~ s/\s.+$//; $g->{$c}++ if length($c) > 0; } @@ -99,6 +99,7 @@ param('where_value',''); param('group_by', $group_by); param('columns', [ @columns ], [ @columns ]); + param('order_by', $columns[0] . ' desc'); } else { $group_by = param('group_by'); }