Self-Answer Time Posted Stats

1

Please login or register to vote for this query.

(click on this box to dismiss)

A breakdown of when self-answers are posted on self-answered questions. An input is provided to generate a user-defined minute interval, in addition to an overall total. Each category has both a percentage and straight total.

German Language Meta

Q&A about the site for speakers of German wanting to discuss the finer points of the language and translation

WITH SelfAnswers AS (
  SELECT q.Id, DATEDIFF(mi, q.CreationDate, a.CreationDate) AS [Minutes]
  FROM Posts AS q
  JOIN Posts a ON a.ParentId = q.Id AND a.OwnerUserID = q.OwnerUserId
)

SELECT
  1 AS [X],
  CONCAT('Within ', ##Minutes:int?15##, ' Minutes') AS [Timeframe],
  COUNT(CASE WHEN Minutes <= ##Minutes:int?15## THEN Id ELSE NULL END) AS [Total],
  AVG(CASE WHEN Minutes <= ##Minutes:int?15## THEN 100 ELSE 0 END) AS [Percent]
FROM SelfAnswers
UNION ALL
SELECT
  2 AS [X],
  'Total' AS [Timeframe],
  COUNT(Id) AS [Total],
  100 AS [Percent]
FROM SelfAnswers
ORDER BY X

-- Minutes: Interval Between Q & Self-Answer (in Minutes):

Enter Parameters

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