Tags grouped by open questions

0

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 [open questions], count(*) as tagcount
from (select count(*) - count(posts.closeddate) as [open questions]
  from posts
  join posttags on(posts.id=posttags.postid)
  join tags on(posttags.tagid=tags.id)
  left join tagsynonyms a on(tags.tagname=a.sourcetagname)
  left join tagsynonyms b on(a.targettagname=b.sourcetagname)
  left join tagsynonyms c on(b.targettagname=c.sourcetagname)
  where posts.posttypeid = 1
  group by coalesce(c.targettagname, b.targettagname, a.targettagname, tags.tagname)
) as t
group by [open questions]
order by [open questions]

Enter Parameters

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