Question Length vs Avg Time To First Answer

0

Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

WITH FirstAnswers AS (
    SELECT
        p.Id AS QuestionId,
        MIN(a.CreationDate) AS FirstAnswerDate
    FROM
        Posts p
    LEFT JOIN
        Posts a ON p.Id = a.ParentId AND a.PostTypeId = 2
    WHERE
        p.PostTypeId = 1 AND
        p.CreationDate > DATEADD(YEAR, -1, GETDATE()) -- Analyzing questions from the last year
    GROUP BY
        p.Id
)

SELECT
    LEN(q.Body) AS QuestionLength,
    AVG(DATEDIFF(MINUTE, q.CreationDate, fa.FirstAnswerDate)) AS AvgTimeToFirstAnswer
FROM
    Posts q
LEFT JOIN
    FirstAnswers fa ON q.Id = fa.QuestionId
WHERE
    q.PostTypeId = 1 AND
    q.CreationDate > DATEADD(YEAR, -1, GETDATE())
GROUP BY
    LEN(q.Body)
ORDER BY
    QuestionLength;

Enter Parameters

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