Sum of up and down votes for all posts of a given user.
Q&A for professional and enthusiast programmers
DECLARE @PostId INT = ##PostId##; SELECT p.Id AS [Post Link] , p.PostTypeId, p.Score , p.ViewCount , CONVERT (VARCHAR(25), p.CreationDate, 100) FROM Posts p WHERE p.Id IN ( SELECT q.id FROM Posts q WHERE q.id = @PostId UNION ALL SELECT a.Id FROM Posts a WHERE a.ParentId = @PostId ) ORDER BY P.Id