Scores of users in tags

1

Please login or register to vote for this query.

(click on this box to dismiss)

Joomla Meta

Q&A about the site for Joomla! administrators, users, developers and designers

; 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 = p.ParentId
  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 main site
loading Hold tight while we fetch your results