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)

Sitecore Meta

Q&A about the site for developers and end users of the Sitecore CMS and multichannel marketing software

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