Tag ratings in dynamic SQL

0

Please login or register to vote for this query.

(click on this box to dismiss)

New version: https://data.stackexchange.com/anime/query/745962/tag-ratings

Anime and Manga

Q&A for anime and manga fans

SELECT TagName,
       Tags.Count AS QuestionCount,
       Sum(Posts.AnswerCount) AS AnswerCount,
       Tags.Count + Sum(Posts.AnswerCount) AS PostCount,
       Sum(Score) + (SELECT SUM(a.Score) FROM Posts a WHERE a.ParentId = Posts.Id GROUP BY a.ParentId)
FROM Tags
INNER JOIN Posts
ON Posts.Tags LIKE '%' + Tags.TagName + '%'
GROUP BY Tags.TagName, Tags.Count, Posts.Id
ORDER BY PostCount DESC

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results