Score of my questions, by tag
Q&A for those committed to a vegan or vegetarian lifestyle and anyone interested in learning more
-- Score of my questions, by tag -- Score of my questions, by tag DECLARE @UserId int = ##UserId## SELECT SUM(p2.Score) as Score, AVG(p2.Score) as AvgScore, COUNT(p2.Id) as "#Answers", t.TagName FROM Posts p JOIN PostTags pt ON pt.PostId = p.Id JOIN Tags t ON t.Id = pt.TagId JOIN Posts p2 ON p2.ParentId = p.id WHERE pt.PostId = p.Id AND t.Id = pt.TagId AND p2.ParentId = p.Id AND p2.OwnerUserId = @UserId GROUP BY pt.TagId, t.TagName ORDER BY SUM(p2.Score) DESC