Percentage of closed questions based on tags

0

Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

-- Percentage of closed questions based on tags.

with totals as(
select top 200
t.TagName as 'Tag',
count(*) as 'TotalQuestions',
count(p.ClosedDate) as 'ClosedQuestions'
from Posts p
join PostTags pt on pt.PostId = p.id
join Tags t on pt.TagId = t.id
group by t.id, t.TagName
order by TotalQuestions desc
)
select *, round(100 * ClosedQuestions/TotalQuestions, 2) as 'Percentage' from totals
order by Percentage desc

Enter Parameters

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