My score for a tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Sum of scores

Super User

Q&A for computer enthusiasts and power users

-- My score for a tag
-- Sum of scores

DECLARE @user int = ##UserId##
--DECLARE @tagname varchar = ##Tag##

select t.TagName as 'Tag', SUM(p.Score) as 'Votes'
from Posts p, Tags t, PostTags pt
where p.OwnerUserId = @user  and p.ParentId = pt.PostId  
and t.Id = pt.TagId and t.TagName = 'c'
group by t.TagName

Enter Parameters

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