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

0

Please login or register to vote for this query.

(click on this box to dismiss)

Portuguese Language

Q&A for linguists, teachers and learners wanting to discuss the finer points of the Portuguese language

With a as
(
   Select 
   CAST(cast(DATEPART(YYYY, p.CreationDate) as float) + cast(DATEPART(MM, p.CreationDate) as float)/12 as float) [Month], 
   p.PostTypeId,
   p.Score,
   VoteTypeId,
   round(1.00*DATEDIFF(day, p.CreationDate, v.CreationDate)/30,0) delay
   from Votes v 
   join Posts p 
   on p.Id = v.PostId 
   where p.PostTypeId in (1,2) and VoteTypeId in (2,3)
) 

select SUM(case when VoteTypeId = 2 then 1.00 when VoteTypeId = 3 then -1.00 else 0.00 end) MonthVotes
from a
group by delay

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results