Get score by post type for UserName

1

Please login or register to vote for this query.

(click on this box to dismiss)

Physical Fitness Meta

Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs

declare @UserId as int
select @UserId = Id From Users where DisplayName = '##UserName##'
Select (Select SUM(Score) From Posts where OwnerUserId = @UserId AND PostTypeId = 2) AS AnswerScore,
(Select SUM(Score) From Posts where OwnerUserId = @UserId AND PostTypeId = 1) AS QuestionScore,
(Select SUM(Score) From Comments where UserId = @UserId) AS CommentScore,
(Select TOP(1) Id From Users where Id = @UserId) As UserId

Enter Parameters

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