q1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Vegetarianism

Q&A for those committed to a vegan or vegetarian lifestyle and anyone interested in learning more

SELECT
    CONCAT(YEAR(CreationDate),'-',MONTH(CreationDate),'-',DAY(CreationDate)) AS creation_date,
    COUNT(CASE WHEN PostTypeId = 1 THEN PostTypeId ELSE NULL END) AS daily_questions,
    COUNT(CASE WHEN PostTypeId = 2 THEN PostTypeId ELSE NULL END) AS daily_answers,
    COUNT(CASE WHEN PostTypeId = 1 AND DeletionDate is null THEN PostTypeId ELSE NULL END) AS daily_questions_undeleted,
    COUNT(CASE WHEN PostTypeId = 2 AND DeletionDate is null THEN PostTypeId ELSE NULL END) AS daily_answers_undeleted
FROM PostsWithDeleted
WHERE YEAR(CreationDate) in (2020,2021,2022,2023,2024)
GROUP BY YEAR(CreationDate), MONTH(CreationDate), DAY(CreationDate)
ORDER BY YEAR(CreationDate), MONTH(CreationDate), DAY(CreationDate)

Enter Parameters

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