Average answers per tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Arqade

Q&A for passionate videogamers on all platforms

declare @tagname  nvarchar (35) = 'html'
select t.tagname as [Tag]
      , min(Posts.AnswerCount) as [Min]
      , avg(cast(Posts.AnswerCount as decimal)) as [Avg]
      , max(Posts.AnswerCount) as [Max]
from Posts
inner join posts a on a.parentid = Posts.id
inner join posttags pt on pt.postid = Posts.id
inner join tags t on t.id = pt.tagid
where t.tagname = @tagname
and Posts.PostTypeId=1
group by t.tagname

Enter Parameters

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