![]() |
Country count
I have database names and there are column country, name, id
like this: Sweden, John, 1 Sweden, Carl, 1 Sweden, Bart, 2 Sweden, Bart, 3 Sweden, Benny, 4 Denmark, Adam, 5 Denmark, Aden, 5 Denmark, Paula, 6 Denmark, Paula, 7 Germany, Rahel, 8 Germany, Rahel, 8 how get: Code:
Sweden 3PHP Code:
|
Code:
select t.state,count(distinct t.name) from temp_table t |
PHP Code:
Code:
Sweden 4it does not work: PHP Code:
|
I looked to quick.
Explain what 3, in expected result, for sweden means ? |
*MAYBE* you are after this?
Code:
SELECT S.country, COUNT( DISTINCT S.minid ) AS theCount |
| All times are GMT +1. The time now is 05:33 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.