Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I got this message (CANNOT_GROUP_WITHOUT_AGG) from a simple query

I how to fix this error message?

Unable to parse query string for Function QUERY parameter 2: CANNOT_GROUP_WITHOUT_AGG

I got that error message just from a simple query formula, I already tried to search about it and try with the curly bracket { ... } but it doesn't fixed, Can anyone help me or ever experienced it?

=QUERY(ANSWER!C:C, "SELECT * GROUP BY C", 0)
like image 585
Khrisna Gunanasurya Avatar asked Jun 10 '17 06:06

Khrisna Gunanasurya


1 Answers

If you don't have an agreggation function (such as sum, avg, count in SELECT), there is no use for GROUP BY - you may just delete it. If you wish to present unique records, use distinct instead.

like image 197
Dimgold Avatar answered Sep 22 '22 11:09

Dimgold