Skip to content
Advertisement

Can I get two count results in a query?

I am using MariaDB. I want to have two count results in a query.

The first query is:

Next is:

What I want to get is:

How can I combine them?

Advertisement

Answer

The usual way is to make a Case..When statement that is one or zero for the desired condition and then SUM it, not COUNT it.

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