Score per answer for users with at least 10 answers in the past 30 days in a tag.


Please login or register to vote for this query.

(click on this box to dismiss)

Physical Fitness Meta

Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs

DECLARE @TagName nvarchar(255) = '##TagName##'
SELECT Posts.OwnerUserId AS [User Link],
           SUM(Score) AS Score,
           COUNT(*) AS Answers,
           ROUND(1.0 * SUM(Score)/COUNT(*), 2) AS ScorePerAnswer
FROM Posts
WHERE Posts.ParentId IN
    (SELECT Posts.Id
     FROM Posts
     INNER JOIN PostTags ON PostTags.PostId = Posts.Id
     INNER JOIN Tags ON Tags.Id = PostTags.TagId
     WHERE Tags.TagName = @TagName)
     AND Posts.CreationDate >= DATEADD(day,-30,GETDATE())
    AND Posts.CreationDate <= GETDATE()
    GROUP BY Posts.OwnerUserId HAVING COUNT(*) > 25
     ORDER BY ScorePerAnswer DESC

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results