Favorites activity by tag


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @UserId int = 680578

--v.*, vt.*, pt.*, tags.*
  FROM votes v
  INNER JOIN votetypes vt ON v.votetypeid = vt.id
  LEFT JOIN posts p ON v.postid = p.id
  LEFT JOIN PostTags pt ON pt.postid = p.id
  INNER JOIN tags ON pt.tagid = tags.id
  WHERE UserId = @UserId
GROUP BY tags.tagname
ORDER BY count(tags.tagname) DESC

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results