Question deletions, compared to the question deletions with positively scored answers, monthly

1

Please login or register to vote for this query.

(click on this box to dismiss)

Computational Science

Q&A for scientists using computers to solve scientific problems

WITH Raw AS (
  SELECT
    Q.Id,
    DATEFROMPARTS(
      DATEPART(yyyy, MIN(Q.DeletionDate)),
      DATEPART(m, MIN(Q.DeletionDate)),
      1) Month,
    CASE WHEN MAX(A.Score) > 0 THEN 1 ELSE NULL END AS HasUpvotedAnswers
  FROM PostsWithDeleted Q
  LEFT JOIN PostsWithDeleted A ON A.ParentId = Q.Id
  WHERE
    Q.DeletionDate IS NOT NULL
  GROUP BY Q.Id
)
SELECT
  Month,
  COUNT(*) AS TotalQDeletions,
  COUNT(HasUpvotedAnswers) AS HasUpvotedAnswers
FROM Raw
GROUP BY Month
ORDER BY Month

Enter Parameters

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