Open and Closed questions per tag

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 coalesce(c.targettagname, b.targettagname, a.targettagname, tags.tagname) as [TagName], count(posts.closeddate) as closed, count(*) - count(posts.closeddate) as 'open'
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)
order by count(*) - count(posts.closeddate)

Enter Parameters

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