Q&A about the site for enthusiasts and scholars of mythology and folklore
WHEN TRIM(Location) = '' THEN 'NULL'
ELSE lower(right(rtrim(Location),charindex(' ',reverse(rtrim(Location))+' ')-1))
END AS location,
COUNT(Id) as number
Reputation >= ##Threshold##
GROUP BY Location
ORDER BY COUNT(Id) DESC