Scores of users in tags

1

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Different

Q&A for power users of Apple hardware and software

---a problem with this query is that it exceeds 50000 rows (maximum in SEDE)
; with scorestags_cte AS
(SELECT
  pt.TagId AS TagId,
  p.OwnerUserId AS uid,
  p.OwnerDisplayname AS udn,
  SUM (p.SCORE) as sco,
  COUNT (p.Id) as num
FROM Posts p INNER JOIN Posts q
  ON q.Id = COALESCE(p.ParentId,p.Id)
--- takes the first expression that is not null (p.ParentId for answer, p.Id for questions)
  INNER JOIN PostTags pt ON q.Id=pt.PostId
WHERE (p.CommunityOwnedDate IS NULL)
---only non-CW
GROUP BY pt.TagId, p.OwnerUserId, p.OwnerDisplayname
)

SELECT
  t.tagname,
  s.uid As [User Link], s.udn,
  s.sco AS [Score],
  s.num AS [Count]
FROM scorestags_cte s INNER JOIN Tags t on s.TagId=t.Id
ORDER BY s.sco DESC

Enter Parameters

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