Answer
Every selected column that isn't itself an aggregate function call needs to be included in the GROUP BY clause — grouping by only one field, or a subset of the non-aggregate columns being selected, produces exactly this error; list all the plain (non-aggregated) selected columns in the GROUP BY, in the same order they're selected, and the error resolves.