Percentage of unanswered questions for a 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 
  count(p.Id) as [Total Questions],
  sum(case when p.AcceptedAnswerId > 0 then 1 else 0 end) as [Answered Questions],
  sum(case when p.AcceptedAnswerId > 0 then 0 else 1 end)*1000 / count(p.Id) / 10.0 as [Percentage Unanaswered]
from 
  Posts as p, 
  PostTags as pt, 
  Tags as t
where p.PostTypeId = 1
  and p.Id = pt.PostId
  and pt.TagId = t.id
  and t.TagName = '##TagName##'

Enter Parameters

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