Number of days until the first answer

1

Please login or register to vote for this query.

(click on this box to dismiss)

Poker Meta

Q&A about the site for serious players and enthusiasts of poker

with answered_cte AS
(
SELECT
  q.Id AS qid,
  q.CreationDate AS created,
  MIN(a.CreationDate) AS answered
FROM Posts q INNER JOIN Posts a ON a.ParentId=q.Id
WHERE (q.PostTypeId=1) and (q.AnswerCount>0)
---only question which have at least one answer
GROUP BY q.Id, q.CreationDate
), times_cte AS
(SELECT
  qid,
  DATEDIFF(day, created, answered) AS Days
FROM answered_cte
)

SELECT
  Days,
  COUNT(qid) AS Count
FROM times_cte
GROUP BY Days
ORDER BY Days ASC

Enter Parameters

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