Ratio of liked questions by month

1

Please login or register to vote for this query.

(click on this box to dismiss)

A question is liked, if 1) its score > 0 2) is not closed 3) is not deleted.

Chess

Q&A for serious players and enthusiasts of chess

SELECT
  DATEFROMPARTS(
    DATEPART(yyyy, CreationDate),
    DATEPART(mm, CreationDate),
    1) AS Month,
  100.0 *
    COUNT(CASE
      WHEN Score > 0 AND ClosedDate IS NULL AND DeletionDate IS NULL THEN 1
      ELSE NULL END) /
    COUNT(*) AS Pct
FROM PostsWithDeleted
WHERE PostTypeId = 1
GROUP BY DATEFROMPARTS(
  DATEPART(yyyy, CreationDate),
  DATEPART(mm, CreationDate),
  1)
ORDER BY Month DESC

Enter Parameters

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