Top UK users by quant tag and location


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- Top users by tag and location
-- Currently only looking at score for questions.  Not sure how to fix this yet.

--SELECT TOP 20 * FROM Posts

SELECT us.*,tuser.Score, tuser.TagName
FROM Users us
(SELECT Answers.OwnerUserId AS UserId, SUM(Answers.Score) AS Score, Tags.TagName
     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 
    IN ('c++') AND Tags.TagName in ('win32')
  GROUP BY Answers.OwnerUserId, Tags.TagName
) tuser ON tuser.UserId = us.Id
lower(location) like '%bulgaria%'

ORDER BY us.Id, tuser.TagName

Enter Parameters

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