Skip to content
Advertisement

MySQL count values and put custom columns

I have this query:

which returns (correctly) :

Now what if I want to group them in custom columns? Like:

I do not have such columns in my table, so I have to get them somehow in the query. Is it even possible?

Advertisement

Answer

You need UNION of four queries. Do a try:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement