declare @UserId int = ##UserId## declare @voteCount int ...


Please login or register to vote for this query.

(click on this box to dismiss)

Open Source Meta

Q&A about the site for people organizing, marketing or licensing open source development projects

declare @UserId int = ##UserId##
declare @voteCount int

select @voteCount = u.UpVotes + u.DownVotes
from Users u
where u.Id = @UserId

SELECT @voteCount AS QuestionVotes, SUM(v.Id) TotalVotes
FROM    Votes v JOIN Posts p ON v.PostId=p.Id
WHERE  UserId =  @UserID;

Enter Parameters

Switch to main site
loading Hold tight while we fetch your results