Q&A about the site for operations research and analytics professionals, educators, and students
WITH CountryUserCounts AS ( SELECT Location, COUNT(*) AS UserCount FROM Users WHERE Location IS NOT NULL AND LEN(Location) > 0 GROUP BY Location ), RankedCountries AS ( SELECT Location, UserCount, RANK() OVER (ORDER BY UserCount DESC) AS Rank FROM CountryUserCounts ) SELECT Rank, Location, UserCount FROM RankedCountries WHERE Location = 'Japan'