Top users by tag and location

1

Please login or register to vote for this query.

(click on this box to dismiss)

With parameters

Audio-Video Production Meta

Q&A about the site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation

SELECT ROW_NUMBER() OVER(ORDER BY tuser.TagScore DESC) AS [#], 
       Id AS [User Link], 
       Reputation,
       tuser.TagScore AS [Tag Score]

FROM Users

JOIN 
(SELECT Answers.OwnerUserId AS UserId, SUM(Answers.Score) AS TagScore
     FROM Tags 
    JOIN PostTags ON Tags.Id = PostTags.TagId
    JOIN Posts ON Posts.Id = PostTags.PostId  
    JOIN Posts Answers ON Answers.ParentId = Posts.Id 
    WHERE LOWER(Tags.TagName) = LOWER('##TagName##')
  GROUP BY Answers.OwnerUserId
) tuser ON tuser.UserId = Users.Id

WHERE LOWER(Location) LIKE LOWER('##Country##')
ORDER BY tuser.TagScore DESC;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results