You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Workbench seems to have been done away with, I had installed the 8.4 server and the 8.0.38 workbench. Apparently with the 8.4 server, sql_mode=only_full_group_by is enabled by default. The problem with this is that
SELECT bands.name AS 'Band Name'
FROM bands
LEFT JOIN albums ON bands.id = albums.band_id
GROUP BY albums.band_id
HAVING COUNT(albums.id) = 0;
Does not work:
Error Code: 1055. Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
'record_company.bands.name' which is not functionally dependent on columns in GROUP BY clause;
this is incompatible with sql_mode=only_full_group_by
bands.name is a non-aggregated column in the SELECT statement. The solution, I think, is changing GROUP BY albums.band_id to GROUP BY bands.id, bands.name.
The text was updated successfully, but these errors were encountered:
Since Workbench seems to have been done away with, I had installed the 8.4 server and the 8.0.38 workbench. Apparently with the 8.4 server,
sql_mode=only_full_group_by
is enabled by default. The problem with this is thatDoes not work:
bands.name
is a non-aggregated column in the SELECT statement. The solution, I think, is changingGROUP BY albums.band_id
toGROUP BY bands.id, bands.name
.The text was updated successfully, but these errors were encountered: