1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| SELECt Country_group, count(*)
from
(
SELECT
case
-- Renommage des pays ---
when country = 'France' then 'FR'
when country IN ('Austria','Germany','Switzerland') then 'DE'
when country IN ('Belgium','Denmark','Ireland','Sweden') then 'ROE'
when country = 'Italy' then 'IT'
when country = 'Netherlands' then 'NL'
when country = 'Spain' then 'ES'
when country = 'United Kingdom' then 'UK'
else 'N/A'
end AS Country_group
FROM
ma_table
WHERE
country IN (
'Austria','Belgium','Denmark','France','Germany','Ireland','Italy','Netherlands','Spain','Sweden','Switzerland','United Kingdom'
)
) AS T
GROUP BY Country_group |
Partager