List of active users from 2021 to 2023

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
    YEAR(CreationDate) AS activity_year,
    MONTH(CreationDate) AS activity_month,
    COUNT(DISTINCT Id) AS active_users
FROM
    Posts p
WHERE
    p.Score >= 0
AND DATEDIFF(day, p.CreationDate, GETDATE()) <= 365*3
GROUP BY
    YEAR(CreationDate),
    MONTH(CreationDate)
ORDER BY
    activity_year ASC,
    activity_month ASC;

Enter Parameters

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