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 '%argentina%' THEN 'argentina'
    WHEN LOWER(Location) LIKE '%armenia%' THEN 'armenia'
    WHEN LOWER(Location) LIKE '%australia%' THEN 'australia'
    WHEN LOWER(Location) LIKE '%austria%' THEN 'austria'
    WHEN LOWER(Location) LIKE '%bangladesh%' THEN 'bangladesh'
    WHEN LOWER(Location) LIKE '%belarus%' THEN 'belarus'
    WHEN LOWER(Location) LIKE '%belgium%' THEN 'belgium'
    WHEN LOWER(Location) LIKE '%brazil%' THEN 'brazil'
    END) as country, COUNT(Id)
FROM 
    Users
GROUP by (CASE WHEN LOWER(Location) LIKE '%argentina%' THEN 'argentina'
    WHEN LOWER(Location) LIKE '%armenia%' THEN 'armenia'
    WHEN LOWER(Location) LIKE '%australia%' THEN 'australia'
    WHEN LOWER(Location) LIKE '%austria%' THEN 'austria'
    WHEN LOWER(Location) LIKE '%bangladesh%' THEN 'bangladesh'
    WHEN LOWER(Location) LIKE '%belarus%' THEN 'belarus'
    WHEN LOWER(Location) LIKE '%belgium%' THEN 'belgium'
    WHEN LOWER(Location) LIKE '%brazil%' THEN 'brazil'
    END)

Enter Parameters

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