Average answer length of a user


Please login or register to vote for this query.

(click on this box to dismiss)

Queries for statistics related to the length of a given user's answers

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @UserId int = ##UserId##

  Count(*) AS [Answer count],
  (SUM(p.Score) * 10 + COUNT(p.Id) * 15) / COUNT(p.Id) 
    AS 'AvgRepPerAnswer',
  Min(Len(p.Body)) AS [MinCharPerAns],
  Avg(Len(p.Body)) AS [AvgCharPerAns],
  Max(Len(p.Body)) AS [MaxCharPerAns]
FROM Users u LEFT JOIN Posts p ON (u.Id = P.OwnerUserId)
WHERE p.OwnerUserId = @UserId
  AND p.PostTypeId = 2
GROUP BY u.Reputation

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results