Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating a query that didn't work. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lzyslh
Copy link

@lzyslh lzyslh commented Sep 27, 2021

The solution for exercise 5 didn't work for me, it returned an error, so I thought that I could submit a fix. Thank you.

@Aunty-Nitty
Copy link

I also got an error. It worked if I grouped by bands.name. The method proposed by another member using WHERE worked for me and seemed like a more straightforward way of doing it.

@lingyutan
Copy link

The solution for exercise 5 didn't work for me either and the error was returned as follow:

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.

It should be working if you replace the 4th command line
"GROUP BY albums.band_id"
by
"GROUP BY bands.id".

I personally think it might be due to albums.band_id is NULL which is not acceptable in MySQL. Also, WHERE is more straightforward in this case as @lzyslh mentioned above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants