Number of tag badges for a specific user

1

Please login or register to vote for this query.

(click on this box to dismiss)

Vegetarianism

Q&A for those committed to a vegan or vegetarian lifestyle and anyone interested in learning more

SELECT
b.UserId AS [User Link],
  sum(case when b.class = 1 then 1 else 0 end) AS gold,
  sum(case when b.class = 2 then 1 else 0 end) AS silver,
  sum(case when b.class = 3 then 1 else 0 end) AS bronze,
  count(b.Id) AS total
FROM Badges b INNER JOIN tags t ON t.tagname=b.name
WHERE b.UserId=##userid?282094##
GROUP By b.UserId

Enter Parameters

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