Average Number of Answers for Quick Accept vs Slow Accept

1

Please login or register to vote for this query.

(click on this box to dismiss)

Physical Fitness

Q&A for physical fitness professionals, athletes, trainers, and those providing health-related needs

WITH SlowAccept AS (
  SELECT
    xId = 1,
    AVG(CAST(p.AnswerCount AS float)) as NumberOfAnswersSA
  FROM
    Posts p INNER JOIN 
    Posts a on a.Id = p.AcceptedAnswerId INNER JOIN
    Votes v on a.Id = v.PostId
  WHERE
    p.PostTypeId = 1 AND
    p.AcceptedAnswerID IS NOT NULL AND
    v.VoteTypeId = 1 AND
    DATEDIFF(day, p.CreationDate, v.CreationDate) > 0 
    ),
  
QuickAccept AS (
  SELECT
    xId = 1,
    AVG(CAST(p.AnswerCount AS float)) as NumberOfAnswersQA
  FROM
    Posts p INNER JOIN 
    Posts a on a.Id = p.AcceptedAnswerId INNER JOIN
    Votes v on a.Id = v.PostId
  WHERE
    p.PostTypeId = 1 AND
    p.AcceptedAnswerID IS NOT NULL AND
    v.VoteTypeId = 1 AND
    DATEDIFF(day, p.CreationDate, v.CreationDate) = 0 
    ),
AcceptedCount AS (
SELECT
  xId = 1,
  COUNT(*) AS AcceptedAnswers
FROM
  Posts p
WHERE
  p.PostTypeId = 1 AND
  p.AcceptedAnswerID IS NOT NULL
)
    
SELECT
  AcceptedAnswers,
  NumberOfAnswersQA,
  NumberOfAnswersSA
FROM
  SlowAccept s INNER JOIN 
  QuickAccept q ON s.xId = q.xId INNER JOIN
  AcceptedCount a ON s.xId = a.xId

Enter Parameters

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