I'm trying to get the count of country visit on my site. I have a SQL table with uid, country and date. I'm then trying to pull count from SQL where I need the count in ordered array like
- US - 53
- UK - 47
- CA - 45
- and so on
It's been far to long time since I've played with SQL queries and I believe its my GROUP BY that fails.
SELECT COUNT(cfCountry) AS count FROM countryTracking GROUP BY cfCountry
But this just returns:
- 8
- 4
- 47
- 2
- 4
- 2
- and so on
How do I make it return the count of the country in ordered with, plus the country in front?