Q&A for active researchers, academics and students of physics
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