PHP Code:
SELECT country, count(distinct name) AS theCount FROM names GROUP BY country ORDER BY theCount DESC
result is:
Code:
Sweden 4
Denmark 3
Germany 1
because no id
it does not work:
PHP Code:
SELECT country, count(distinct name and id) AS theCount FROM names GROUP BY country ORDER BY theCount DESC