Shows user's: * total answer count * accepted answer count * upvoted/zero-voted/downvoted answer counts
Q&A for SharePoint enthusiasts
-- Accepted Answer Statistics DECLARE @UserId int = ##UserId## SELECT Count(*) AS [All], Sum(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS [Accepted], Sum(CASE WHEN a.Score > 0 THEN 1 ELSE 0 END) AS [Upvoted], Sum(CASE WHEN a.Score = 0 THEN 1 ELSE 0 END) AS [Zero Voted], Sum(CASE WHEN a.Score < 0 THEN 1 ELSE 0 END) AS [Downvoted] FROM Posts a LEFT JOIN Posts q ON q.AcceptedAnswerId = a.Id WHERE a.OwnerUserId = @UserID AND a.PostTypeId = 2