From: Sven Schöling Date: Fri, 27 Jul 2007 11:45:15 +0000 (+0000) Subject: Group_BY muss conditional sein X-Git-Tag: release-2.6.0beta1~550 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=cb9063bd313ecc2949fd9190301c7f7fe93d5cab;p=kivitendo-erp.git Group_BY muss conditional sein --- diff --git a/SL/IC.pm b/SL/IC.pm index fe666ec14..b615298a7 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -987,7 +987,7 @@ sub all_parts { my $select_clause = join ', ', map { ($table_prefix{$_} || "p.") . $_ } @select_tokens; my $join_clause = join ' ', @joins{ grep $joins_needed{$_}, @join_order }; my $where_clause = join ' AND ', map { "($_)" } @where_tokens; - my $group_clause = ' GROUP BY ' . join ', ', map { ($table_prefix{$_} || "p.") . $_ } @group_tokens; + my $group_clause = ' GROUP BY ' . join ', ', map { ($table_prefix{$_} || "p.") . $_ } @group_tokens if scalar @group_tokens; my $query = qq|SELECT DISTINCT $select_clause FROM parts p $join_clause WHERE $where_clause $group_clause $order_clause $limit_clause|; $form->{parts} = selectall_hashref_query($form, $dbh, $query, @bind_vars);