Q&A for SharePoint enthusiasts
DECLARE @UserId INT = ##UserId##; -- Calculate average scores for answers, questions, and total posts SELECT AVG(CASE WHEN p.PostTypeId = 2 THEN p.Score END) AS AverageAnswerScore, AVG(CASE WHEN p.PostTypeId = 1 THEN p.Score END) AS AverageQuestionScore, AVG(p.Score) AS AveragePostScore FROM Posts p WHERE p.OwnerUserId = @UserId