Potential tag badges waiting for more answers

1

Please login or register to vote for this query.

(click on this box to dismiss)

Science Fiction and Fantasy

Q&A for science fiction and fantasy enthusiasts

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
where
    a.posttypeid = 2  -- answers
and a.CommunityOwnedDate is NULL  -- not community wiki
and a.OwnerUserId = ##UserId##
group by t.TagName
having 
   (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 "Answer #" desc, "Tag score" desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results