Positively voted vs negatively voted questions in Programmers StackExchange

0

Please login or register to vote for this query.

(click on this box to dismiss)

Engineering

Q&A for professionals and students of engineering

SELECT
  dateadd(month, datediff(month, 0, CreationDate), 0) [Month],
  SUM(Negative) [Negative Questions],
  SUM(Positive) [Positive Questions]
FROM
(
SELECT
    [CreationDate],
    CASE WHEN Score < 0 THEN 1 ELSE 0 END [Negative],
    CASE WHEN Score > 0 THEN 1 ELSE 0 END [Positive]
  FROM Posts
  WHERE
    PostTypeID = 1
    AND Score != 0
    AND CreationDate >= '1/1/2011'
) [NegativeAndPositivePostCounts]
GROUP BY
  dateadd(month, datediff(month, 0, CreationDate), 0)
ORDER BY
  [Month]

Enter Parameters

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