Average votes per tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

-- Average votes per tag

select top 400 TagId
into #tags
from Tags 
join PostTags on TagId = Id 
group by TagId 
order by count(*) desc 


select TagId, TagName, Avg(a.Score + 0.0), count(distinct q.Id)  from Posts q 
join PostTags p on q.Id = p.PostId
join Tags t on t.Id = p.TagId    
join Posts a on a.ParentId = q.Id
where TagId in (
    select * from #tags
) and q.CommunityOwnedDate is null and a.CommunityOwnedDate is null
group by TagId, TagName 
order by Avg(a.Score + 0.0) asc

Enter Parameters

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