I am trying to get the below statement to work with mysql v5.7.5, although really dont understand the wording at all in the error message and the documentation doesnt help me either.
The SQL Statement in question:
SELECT
YEARWEEK(ts) AS YW,
DATE(ts) AS D,
SUM(`group-size`) AS `sum`
FROM `event`
GROUP BY YEARWEEK(ts);
The error I get:
Expression #2 of SELECT list is not in GROUP BY clause and contains
nonaggregated column 'event.ts' which is not functionally dependent on
columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Can someone please explain in english how I can get it working? To my the SQL statement makes perfect sense however It is just throwing up the error every time.