Subjective tags, tags that often result in wiki

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

-- Subjective tags, tags that often result in wiki

set nocount on 

declare @toptags table(id int)

insert @toptags 
select top 200 t.Id
from Tags t 
join PostTags pt on t.id = pt.TagId 
join Posts p on p.Id = pt.PostId and p.ParentId is null 
group by t.Id
order by count(*) desc 

set nocount off
select top 200 TagName, count(*) as total, 
( sum(case when ClosedDate is not null then 1 else 0 end) / (0.0 + count(*)) ) * 100 as closed, 
( sum(case when CommunityOwnedDate is not null then 1 else 0 end) / (0.0 + count(*))) * 100 as wiki
from Tags t 
join PostTags pt on t.id = pt.TagId 
join Posts p on p.Id = pt.PostId and p.ParentId is null 
where t.id in (select * from @toptags)
group by TagName 
order by 4 desc 

Enter Parameters

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