SELECT SUM(CASE WHEN p.Score > 0 THEN 1 ELSE 0 END) AS Po...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Meta Stack Exchange

Q&A for meta-discussion of the Stack Exchange family of Q&A websites

SELECT
  SUM(CASE WHEN p.Score > 0 THEN 1 ELSE 0 END) AS Positive,
  SUM(CASE WHEN p.Score = 0 THEN 1 ELSE 0 END) AS Neutral,
  SUM(CASE WHEN p.Score < 0 THEN 1 ELSE 0 END) AS Negative,
  t.TagName
FROM
  Posts p
  INNER JOIN PostTags pt ON p.Id = pt.PostId
  INNER JOIN Tags t ON pt.TagId = t.Id
WHERE
  p.PostTypeId = 1
GROUP BY
  t.TagName
ORDER BY
  COUNT(*) DESC

Enter Parameters

Options:
Switch sites
loading Hold tight while we fetch your results