Percentage of questions with downvotes

0

Please login or register to vote for this query.

(click on this box to dismiss)

Robotics Meta

Q&A about the site for professional robotic engineers, hobbyists, researchers and students

SELECT CONVERT(VARCHAR(7), P.CreationDate, 126),
       COUNT(DISTINCT P.Id),
       COUNT(DISTINCT CASE WHEN V.VoteTypeId = 2 THEN P.Id END),
       COUNT(DISTINCT CASE WHEN V.VoteTypeId = 3 THEN P.Id END),
       COUNT(DISTINCT CASE WHEN V.VoteTypeId = 3 AND C.Id IS NULL THEN P.Id END),
       COUNT(DISTINCT CASE WHEN P.Score < 0 THEN P.Id END)
  FROM Posts P
  LEFT JOIN Votes V
    ON V.PostId = P.Id
  LEFT JOIN Comments C
    ON C.PostId = P.Id
 WHERE P.PostTypeId = 1
 GROUP BY CONVERT(VARCHAR(7), P.CreationDate, 126)
 ORDER BY 1
 ;

Enter Parameters

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