List of Most reputed users in a given location - Case Sensitive

Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs

SELECT * FROM
(SELECT TOP 100
'Gold' AS [Type],
UserId AS [User Link],
Count(*) as [Count]
FROM Badges b
INNER JOIN users u ON u.id = b.userid
WHERE location like '%##Location##%' AND CreationDate like '2017' AND Class=1
GROUP BY UserId
ORDER BY [Count] DESC
) g