Average wait time for first response based on hour of asking

0

Please login or register to vote for this query.

(click on this box to dismiss)

TeX - LaTeX

Q&A for users of TeX, LaTeX, ConTeXt, and related typesetting systems

SELECT 
  DATEPART(HOUR, QuestionWithT.CDate) AS AskingHour,
  AVG(QuestionWithT.T) AS AvgWaitTimeForFirstResponse
FROM (
  SELECT Question.Id as Id,
    MIN(Question.CreationDate) as CDate, -- Why do i need a reduction here? There is only 1 CreationDate for 1 Question
    MIN(DATEDIFF(MINUTE, Question.CreationDate, Answer.CreationDate)) / (24.0 * 60) AS T
  FROM Posts as Question, Posts as Answer
  WHERE Answer.ParentId = Question.Id AND Question.PostTypeId = 1 AND Answer.PostTypeId = 2
  GROUP BY Question.Id
) as QuestionWithT
GROUP BY DATEPART(HOUR, QuestionWithT.CDate)

Enter Parameters

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