Q&A about the site for members of the workforce navigating the professional setting
SELECT * FROM (SELECT T.TagName, Year(a.creationDate) yr, Substring(DateName(m,a.creationDate),1,3) mh, SUM(a.score) Total FROM Posts a INNER JOIN Posts q ON a.ParentID = q.id INNER JOIN postTags pt ON q.id = pt.PostId INNER JOIN Tags t ON Pt.TagiD = t.id WHERE a.owneruserID = ##UserID## GROUP BY t.TagName, Year(a.creationDate) , Substring(DateName(m,a.creationDate),1,3) WITH ROLLUP ) SourceTable PIVOT ( sum( Total ) FOR mh IN ([Jan],[Feb],[Mar],[Apr],[May],[Jun],[Jul],[Aug],[Sep],[Oct],[Nov],[Dec]) ) AS PivotTable