Distribution of score aquired as function of age for questions and answers


Please login or register to vote for this query.

(click on this box to dismiss)

Science Fiction and Fantasy Meta

Q&A about the site for science fiction and fantasy enthusiasts

with a as
   select [Month], PostTypeId, 
           SUM(case when VoteTypeId = 2 then 1.00 when VoteTypeId = 3 then -1.00 else 0.00 end) quickVotes
   from Votes v 
   (   Select CAST(cast(DATEPART(YYYY, CreationDate) as float) + cast(DATEPART(MM, CreationDate) as float)/12 as float) [Month], 
          Id, CreationDate, AnswerCount, PostTypeId from Posts
   ) p 
       on p.Id = v.PostId 
       where DATEDIFF(day, p.CreationDate, v.CreationDate)
             BETWEEN 0 AND 30
       and p.PostTypeId in (1,2)
   group by [postId], [Month], PostTypeId

select [Month], 
       case when PostTypeId = 1 then 'question' else 'answer' end,
from a
group by [Month], PostTypeId
order by [Month]

Enter Parameters

Switch to main site
loading Hold tight while we fetch your results