A column in a select column or in the HAVING clause was specified that is not a group column. In other words, it is not contained in the GROUP clause. Columns which are not group columns may only occur in arguments of the functions COUNT, SUM, AVG, MAX, MIN, STDDEV and VARIANCE.
Insert the specified column into the <group clause> as a further group column or remove it from the select column or HAVING clause.