Silver tag badge holders


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- Identify tag badges as the badges whose name doesn't start with an uppercase letter.
-- Identify silver tag badges because the same user has two badges by that name.

-- FIXME: gold badge holders are shown in triplicate, rather than shown with True in the [Gold] column as I would like.

  'site://tags/' + b.Name + '/info|' + b.Name AS [Tag],
  u.Id AS [User Link],
--  (EXISTS (SELECT bbb.Id FROM Badges bbb
--           WHERE bbb.UserId = b.UserId AND bbb.Name = b.Name
--             AND bbb.Id > bb.Id)) AS [Gold],
  u.Reputation AS [Rep],
  u.UpVotes + u.DownVotes AS [Votes]
FROM Badges b
INNER JOIN Users u ON u.Id = b.UserId
RIGHT JOIN Badges bb ON bb.UserId = b.UserId
                    AND bb.Name = b.Name
                    AND bb.Id > b.Id
ORDER BY b.Name ASC, u.Reputation DESC, u.Id ASC

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results