Favorites activity by tag

0

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


SELECT
--v.*, vt.*, pt.*, tags.*
tags.tagname
,count(tags.tagname)
  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

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