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 '%ukraine%' THEN 'ukraine'
    WHEN LOWER(Location) LIKE '%uae%' THEN 'uae'
    WHEN LOWER(Location) LIKE '%emirates%' THEN 'emirates'
    WHEN LOWER(Location) LIKE '% usa %' THEN 'usa '
    WHEN LOWER(Location) LIKE '%states' THEN 'states'
    WHEN LOWER(Location) LIKE '%vietnam%' THEN 'vietnam'
    END) as country, COUNT(Id)
FROM 
    Users
WHERE
    Reputation >= 1000
GROUP by     (CASE WHEN LOWER(Location) LIKE '%ukraine%' THEN 'ukraine'
    WHEN LOWER(Location) LIKE '%uae%' THEN 'uae'
    WHEN LOWER(Location) LIKE '%emirates%' THEN 'emirates'
    WHEN LOWER(Location) LIKE '% usa %' THEN 'usa '
    WHEN LOWER(Location) LIKE '%states' THEN 'states'
    WHEN LOWER(Location) LIKE '%vietnam%' THEN 'vietnam'
    END)

Enter Parameters

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