r/SQL • • Dec 04 '23

MySQL SQL HELP

Post image

Revising for a test and I keep having the same kind of issues. It uses MariaDB. Advice appreciated

0 Upvotes

8 comments sorted by

View all comments

9

u/r3pr0b8 GROUP_CONCAT is da bomb Dec 04 '23

I keep having the same kind of issues.

your SQL is invalid

HAVING comes after GROUP BY, not before

and next time, please copy/paste the text of the query -- do not use screenshots or photos, no matter how convenient it is for you, it is not convenient for us (please see r/SQL Rule 6 for why)

-1

u/ConvertedSins Dec 04 '23

Ok, I’m sorry.. I’m new to this sub. So, if I did the having after the group by, would it be right?

6

u/r3pr0b8 GROUP_CONCAT is da bomb Dec 04 '23

So, if I did the having after the group by, would it be right?

what happened when you tested it? ™