StackOverflow users from Ukraine with the highest reputation by certain tag.
Q&A for people interested in the history and origins of science and mathematics
SELECT ROW_NUMBER() OVER(ORDER BY Score DESC) AS [#], us.id [User Link], us.DisplayName, 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 LOWER(us.Location) LIKE '%ukraine%' ORDER BY Score DESC;