Potential tag badges waiting for more votes


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select t.TagName as "Tag"
,      case
          when (count(1) >= 20 and sum(a.score) < 100) then 'bronze'
          when (count(1) >= 80 and sum(a.score) < 400) then 'silver'
          else 'gold'
       end "Upcoming tag badge"
,      count(1) as "Answer #"
,      sum(a.score) as "Tag score"
from tags t
inner join posttags pt on pt.tagid = t.id
inner join posts q on q.id = pt.postid
inner join posts a on a.parentid = q.id
    a.posttypeid = 2  -- answers
and a.CommunityOwnedDate is NULL  -- not community wiki
and a.OwnerUserId = ##UserId##
group by t.TagName
   (count(1) >= 20 and sum(a.score) < 100)
or (count(1) >= 80 and sum(a.score) < 400)
or (count(1) >= 200 and sum(a.score) < 1000)
order by "Tag score" desc

Enter Parameters

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