Top Users by Country

0

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

SELECT 
    (CASE WHEN LOWER(Location) LIKE '%spain%' THEN 'spain'
    WHEN LOWER(Location) LIKE '%sri lanka%' THEN 'sri lanka'
    WHEN LOWER(Location) LIKE '%sweden%' THEN 'sweden'
    WHEN LOWER(Location) LIKE '%switzerland%' THEN 'switzerland'
    WHEN LOWER(Location) LIKE '%taiwan' THEN 'taiwan'
    WHEN LOWER(Location) LIKE '%thailand%' THEN 'thailand'
    WHEN LOWER(Location) LIKE '%tunisia%' THEN 'tunisia'
    WHEN LOWER(Location) LIKE '%turkey%' THEN 'turkey'
    END) as country, COUNT(Id)
FROM 
    Users
WHERE
    Reputation >= 1000
GROUP by     (CASE WHEN LOWER(Location) LIKE '%spain%' THEN 'spain'
    WHEN LOWER(Location) LIKE '%sri lanka%' THEN 'sri lanka'
    WHEN LOWER(Location) LIKE '%sweden%' THEN 'sweden'
    WHEN LOWER(Location) LIKE '%switzerland%' THEN 'switzerland'
    WHEN LOWER(Location) LIKE '%taiwan' THEN 'taiwan'
    WHEN LOWER(Location) LIKE '%thailand%' THEN 'thailand'
    WHEN LOWER(Location) LIKE '%tunisia%' THEN 'tunisia'
    WHEN LOWER(Location) LIKE '%turkey%' THEN 'turkey'
    END)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results