Number of authors per answer (non-CW)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Distribution of the number of co-authors per answer (excluding community wiki)

Webmasters

Q&A for pro webmasters

-- Number of authors per answer (non-CW)
-- Distribution of the number of co-authors per answer
-- (excluding community wiki)

WITH TotalAnswers AS (
    SELECT Cast(Count(*) AS FLOAT) AS Count
    FROM Posts
    WHERE PostTypeId = 2
      AND CommunityOwnedDate IS NULL
)
SELECT
  a.Authors AS [Authors],
  Count(*) AS [Answers],
  Round(Count(*) / (SELECT Count FROM TotalAnswers) * 100, 1) As [Percent]
FROM (
    SELECT
      PostId, Count(DISTINCT UserId) As [Authors]
    FROM PostHistory
    WHERE PostHistoryTypeId = 5
       OR PostHistoryTypeId = 2
    GROUP BY PostId
  ) AS a
INNER JOIN Posts p ON p.Id = a.PostId
WHERE p.PostTypeId = 2
  AND p.CommunityOwnedDate IS NULL
GROUP BY a.Authors
ORDER BY Authors

Enter Parameters

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