Top Users by Country and tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Created by samliew (http://stackoverflow.com/users/584192/samuel-liew)

Music Fans

Q&A for music historians, critics, and fans

SELECT ROW_NUMBER() OVER(ORDER BY Reputation DESC) AS [#], us.id [User Link],
       us.DisplayName,
       us.age,
       tuser.Score
       
FROM Users us

JOIN 
(SELECT Answers.OwnerUserId AS UserId, SUM(Answers.Score) AS Score
     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 Tags.TagName = '##TagName##'
  GROUP BY Answers.OwnerUserId
) tuser ON tuser.UserId = us.Id

WHERE --UPPER(us.Location) like UPPER('%##Country##%')
us.Id = 8214734
ORDER BY Score DESC;

Enter Parameters

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