Age-Score correlation

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

-- this script will bin the collective score of answers as a function
--  of age between asking the Q and posting the A. 

SELECT
   DATEDIFF(dd, Question.CreationDate, Answer.CreationDate) AS [Date Difference],
   ROUND(AVG(CONVERT(FLOAT, Answer.Score)), 2) AS [Average score],
   COUNT(*) AS [Answer Count]
FROM Posts AS Answer LEFT JOIN Posts AS Question ON Answer.ParentId = Question.Id
   WHERE DATEDIFF(dd, Question.CreationDate, Answer.CreationDate) > 0
     AND Question.ClosedDate IS NULL
GROUP BY DATEDIFF(dd, Question.CreationDate, Answer.CreationDate)
ORDER BY [Date Difference] ASC

Enter Parameters

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