Find Users by Most Badges
DECLARE @BadgeName AS NVARCHAR(50) = ##BadgeName:string?Great Answer##;
DECLARE @MyTop AS INT = ##MyTop:int?100##;

SELECT TOP(@MyTop)
    Badges.UserId AS [User Link],
    Users.Reputation,
    @BadgeName AS BadgeName,
    COUNT(Badges.Id) AS NumberOfBadges
FROM  Badges 
  INNER JOIN Users ON Users.Id=Badges.UserId
WHERE Badges.Name = @BadgeName
  AND Users.Reputation &gt; 10000
GROUP BY Badges.UserId, Users.Reputation
ORDER BY NumberOfBadges DESC


The DECLARE statements should have semi-colons at the end.  

Apparently you need the parentheses when using SELECT TOP with a variable.  

As you noticed, you need to put columns in the GROUP BY to include them in the SELECT.  You can get around this by using the variable instead of the column.  

I prefer capitalized keywords and a more compact formatting, but that's really up to you.