groupBy must not include aggregate functions