Percentage of questions with accepted answers, based on tags.

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

-- Percentage of questions with accepted answers, based on tags.

with totals as(
select top 200
t.TagName as 'Tag',
count(*) as 'TotalQuestion',
count(p.AcceptedAnswerId) as 'TotalAccepted'
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 TotalQuestion desc
)
select *, round(100 * TotalAccepted/TotalQuestion, 2) as 'Percentage' from totals
--where totals.TotalQuestion > 2000
order by Percentage desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached