Questions asked (per month). Questions deleted (per month)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Run the query and select the 'Graph' tab. Learn about how many questions have been asked by month; and compare to how many questions have been deleted per month.

GIS

Q&A for cartographers, geographers and GIS professionals

WITH cte (date_bin, asked, deleted)
AS (
    SELECT p.CreationDate AS date_bin, 1 AS asked, 0 AS deleted
    FROM PostsWithDeleted p
    WHERE p.PostTypeId = 1 --questions
    UNION ALL
    SELECT p.DeletionDate AS date_bin, 0 AS asked, 1 AS deleted
    FROM PostsWithDeleted p
    WHERE p.PostTypeId = 1 --questions
   )
SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, date_bin), 0) AS date_bin, -- yyyy_mm
SUM(asked) AS asked, 
SUM(deleted) AS deleted--,
--SUM(asked) - SUM(deleted) AS [asked - deleted]
FROM cte
WHERE date_bin >= Convert(datetime, '2011-03-01')  -- GIS SE graduation date (https://normalhuman.github.io/timeline/)
GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, date_bin), 0) -- yyyy_mm
ORDER BY DATEADD(MONTH, DATEDIFF(MONTH, 0, date_bin), 0);

Enter Parameters

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