The 'select' clause is not valid. Aggregate functions in 'select' clause require a 'group by' clause in the query.
Explanation
A 'group by' clause is required when using an aggregate function in the 'select' clause in the query.
User response
Add a 'group by' clause with attributes in the 'select' clause in the query.