# move somewhere else just yet.
my @ret = (
($dq->{from} ? $self->_render($dq->{from}) : ()),
- $self->_format_keyword('GROUP BY'),
- intersperse(',', map $self->_render($_), @{$dq->{by}})
+ (@{$dq->{by}}
+ ? (
+ $self->_format_keyword('GROUP BY'),
+ intersperse(',', map $self->_render($_), @{$dq->{by}})
+ )
+ : ())
);
\@ret;
}