Votes within 48 hours of new questions, last month

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 CAST(p.CreationDate AS DATE), SUM(CASE WHEN DATEDIFF(day, p.CreationDate, v.CreationDate) < 2 AND VoteTypeId = 2 THEN 1.0 WHEN DATEDIFF(day, p.CreationDate, v.CreationDate) < 2 AND VoteTypeId = 3 THEN -1.0 ELSE 0.0 END) / COUNT(DISTINCT PostId)
  FROM PostsWithDeleted p 
  INNER JOIN Votes v ON v.PostId = p.Id  AND VoteTypeId in(2,3)
  WHERE p.PostTypeId = 1
  AND p.CreationDate BETWEEN DATEADD(month,-1, GETDATE()) AND  GETDATE()
  GROUP BY CAST(p.CreationDate AS DATE)
  ORDER BY CAST(p.CreationDate AS DATE)

Enter Parameters

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