I have a table listing some organizations, and some details, as the country they are in.
I need to count the number of organizations in each country, and I managed that with this query:
SELECT COUNTRY, COUNT(*) AS ORGANIZATIONS FROM ORGANIZATION GROUP BY COUNTRY
This gives me a result set like this:
COUNTRY | ORGANIZATION
--------+-------------
UK | 12
FR | 7
NL | 9
This is good, but a better result I'm looking for is a single row result, like this:
UK | FR | NL
---+----+---
12 | 7 | 9
Any ideas on how to do that in MySQL alone?