Average Answer Score for a User

2

Please login or register to vote for this query.

(click on this box to dismiss)

Shows the average score for a given user's answers, as well as their total number of answers and the average reputation (simple multiplication by 10) for convenience.

Stack Overflow

Q&A for professional and enthusiast programmers

-- Shows the average score for a given user's
-- answers, as well as their total number of
-- answers and the average reputation (simple
-- multiplication by 10) for convenience.

SELECT
  COUNT(1) as [Number of Answers],
  ROUND(AVG(CAST(a.Score as Decimal)), 4) as [Average Answer Score],
  ROUND(AVG(CAST(a.Score as Decimal)), 4) * 10 as [Average Answer Reputation]
FROM Posts a
INNER JOIN
  Posts q ON a.ParentId = q.Id
WHERE a.OwnerUserId = ##UserId:int##

Enter Parameters

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