More GROUP BY fun, fixes bug #9363, thanks to Mathias Behrie