Top N tag scores

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- The top tag scores on a site

SELECT TOP(##limit:int?25##)
  MIN(u.id) as [User Link],
  t.TagName, SUM(a.Score) as [Tag Score],
  COUNT(*) as [Answer count]
FROM Users u
INNER JOIN Posts a ON a.OwnerUserId = u.id
INNER JOIN Posts q ON a.ParentId = q.Id
INNER JOIN PostTags pt ON pt.PostId = q.Id
INNER JOIN Tags t ON t.Id = pt.TagId
WHERE a.CommunityOwnedDate IS NULL   -- CW post don't count towards a tag score
GROUP BY u.id, t.TagName
ORDER BY SUM(a.Score) DESC

Enter Parameters

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