TOP 100 users of a Tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Computational Science

Q&A for scientists using computers to solve scientific problems

;WITH CTE
AS
(
  SELECT 
    ROW_NUMBER() OVER(ORDER BY COUNT(*) DESC) Rank,
    u.DisplayName,
    TagName, 
    u.Location,
    COUNT(*) AS UpVotes
  FROM Tags t
      INNER JOIN PostTags pt ON pt.TagId = t.id
      INNER JOIN Posts     p ON p.ParentId = pt.PostId
      INNER JOIN Votes     v ON v.PostId = p.Id and VoteTypeId = 2
      INNER JOIN Users     u ON u.Id = p.OwnerUserId
  WHERE 
    TagName = 'java' AND u.location LIKE '%Egypt%'
  GROUP BY u.DisplayName, TagName, u.Location
)
SELECT *
FROM CTE WHERE rank <= 100
ORDER BY upvotes DESC;

Enter Parameters

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