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 '%kenya%' THEN 'kenya'
    WHEN LOWER(Location) LIKE '%latvia%' THEN 'latvia'
    WHEN LOWER(Location) LIKE '%lithuania%' THEN 'lithuania'
    WHEN LOWER(Location) LIKE '%malaysia%' THEN 'malaysia'
    WHEN LOWER(Location) LIKE '%mexico' THEN 'mexico'
    WHEN LOWER(Location) LIKE '%morocco%' THEN 'morocco'
    WHEN LOWER(Location) LIKE '%nepal%' THEN 'nepal'
    WHEN LOWER(Location) LIKE '%netherlands%' THEN 'netherlands'
    END) as country, COUNT(Id)
FROM 
    Users
WHERE
    Reputation >= 1000
GROUP by     (CASE WHEN LOWER(Location) LIKE '%kenya%' THEN 'kenya'
    WHEN LOWER(Location) LIKE '%latvia%' THEN 'latvia'
    WHEN LOWER(Location) LIKE '%lithuania%' THEN 'lithuania'
    WHEN LOWER(Location) LIKE '%malaysia%' THEN 'malaysia'
    WHEN LOWER(Location) LIKE '%mexico' THEN 'mexico'
    WHEN LOWER(Location) LIKE '%morocco%' THEN 'morocco'
    WHEN LOWER(Location) LIKE '%nepal%' THEN 'nepal'
    WHEN LOWER(Location) LIKE '%netherlands%' THEN 'netherlands'
    END)

Enter Parameters

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