Average Answer Score

0

Please login or register to vote for this query.

(click on this box to dismiss)

The minumum, maximum and average answer score for a user. New version: Calculates average as a float instead of an int. New new version: Uses 'UserId' instead of 'userId'.

Stack Overflow

Q&A for professional and enthusiast programmers

-- Average Answer Score
-- The minumum, maximum and average answer score for a user.
-- New version: Calculates average as a float instead of an int.
-- New new version: uses  'UserId' instead of 'userId'

SELECT MIN(Score) AS Minimum,
       MAX(Score) AS Maximum,
       (SUM(Score) + 0.0) / Count(*) AS Average
  FROM Posts
 WHERE PostTypeId = 2
   AND OwnerUserId =  ##UserId##

Enter Parameters

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