For a particular tag, average Upvotes per Answer per user

0

Please login or register to vote for this query.

(click on this box to dismiss)

Programming Puzzles and Code Golf

Q&A for programming puzzle enthusiasts and code golfers

-- For a particular tag, average Upvotes per Answer per user

SELECT
   TOP 200
   Users.Id,
   Users.DisplayName,
   COUNT(Posts.Id) As NumPosts,
   SUM(Posts.Score) As SumScore,
   AVG(Posts.Score) As AvgScore
FROM Posts
INNER JOIN Users ON Posts.OwnerUserID = Users.Id
WHERE Posts.PostTypeID = 2
AND Posts.ParentId IN (
-- Posts with a particular tag
SELECT
Posts.Id
FROM Posts
INNER JOIN PostTags ON Posts.Id = PostTags.PostId
INNER JOIN Tags ON PostTags.TagId = Tags.Id
WHERE Posts.PostTypeID = 1
AND Tags.TagName = '##tagname##'
)

GROUP BY Users.Id, Users.DisplayName

Enter Parameters

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