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 '%pakistan%' THEN 'pakistan'
    WHEN LOWER(Location) LIKE '%peru%' THEN 'peru'
    WHEN LOWER(Location) LIKE '%philippines%' THEN 'philippines'
    WHEN LOWER(Location) LIKE '%poland%' THEN 'poland'
    WHEN LOWER(Location) LIKE '%portugal%' THEN 'portugal'
    WHEN LOWER(Location) LIKE '%new zealand%' THEN 'new zealand'
    WHEN LOWER(Location) LIKE '%nigeria%' THEN 'nigeria'
    WHEN LOWER(Location) LIKE '%norway%' THEN 'norway'
    END) as country, COUNT(Id)
FROM 
    Users
GROUP by     (CASE WHEN LOWER(Location) LIKE '%pakistan%' THEN 'pakistan'
    WHEN LOWER(Location) LIKE '%peru%' THEN 'peru'
    WHEN LOWER(Location) LIKE '%philippines%' THEN 'philippines'
    WHEN LOWER(Location) LIKE '%poland%' THEN 'poland'
    WHEN LOWER(Location) LIKE '%portugal%' THEN 'portugal'
    WHEN LOWER(Location) LIKE '%new zealand%' THEN 'new zealand'
    WHEN LOWER(Location) LIKE '%nigeria%' THEN 'nigeria'
    WHEN LOWER(Location) LIKE '%norway%' THEN 'norway'
    END)

Enter Parameters

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