average score by 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 tagname, count(p.id) as count, avg(score) as AvgScore
from posts p
INNER JOIN PostTags pt ON pt.PostId = p.Id
INNER JOIN Tags t ON pt.TagId = t.Id
WHERE p.ParentId IS NULL 
--and t.tagname in ('c', 'php','javascript')
 group by t.tagname
order by avgscore desc

Enter Parameters

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