Number of upvotes for posts by a certain user in a certain tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Meta Stack Exchange

Q&A for meta-discussion of the Stack Exchange family of Q&A websites

SELECT COUNT(*) AS 'Number of upvotes'
  FROM Posts AS p
  INNER JOIN PostTags AS pt
    ON COALESCE(p.ParentId, p.Id) = pt.PostId
  INNER JOIN Tags AS t
    ON t.Id = pt.TagId
  INNER JOIN Votes AS v
    ON v.PostId = p.Id
  WHERE v.VoteTypeId = 2 -- Upvote
    AND p.OwnerUserId = ##UserId:int##
    AND t.TagName = ##TagName:string##

Enter Parameters

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