Revision cb9063bd
Von Sven Schöling vor mehr als 17 Jahren hinzugefügt
SL/IC.pm | ||
---|---|---|
987 | 987 |
my $select_clause = join ', ', map { ($table_prefix{$_} || "p.") . $_ } @select_tokens; |
988 | 988 |
my $join_clause = join ' ', @joins{ grep $joins_needed{$_}, @join_order }; |
989 | 989 |
my $where_clause = join ' AND ', map { "($_)" } @where_tokens; |
990 |
my $group_clause = ' GROUP BY ' . join ', ', map { ($table_prefix{$_} || "p.") . $_ } @group_tokens; |
|
990 |
my $group_clause = ' GROUP BY ' . join ', ', map { ($table_prefix{$_} || "p.") . $_ } @group_tokens if scalar @group_tokens;
|
|
991 | 991 |
|
992 | 992 |
my $query = qq|SELECT DISTINCT $select_clause FROM parts p $join_clause WHERE $where_clause $group_clause $order_clause $limit_clause|; |
993 | 993 |
$form->{parts} = selectall_hashref_query($form, $dbh, $query, @bind_vars); |
Auch abrufbar als: Unified diff
Group_BY muss conditional sein