RQ1.Weekly Participation

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mythology Meta

Q&A about the site for enthusiasts and scholars of mythology and folklore

SELECT OwnerUserId, 
       DATEPART(WEEK, CreationDate) AS WeekNumber, 
       COUNT(PostTypeId) AS PostsCount,
       SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS QuestionsCount,
       SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS AnswersCount
FROM Posts
WHERE OwnerUserId IN (
    SELECT Id 
    FROM Users 
    WHERE CreationDate BETWEEN '2008-01-01' AND '2024-10-01'
)
GROUP BY OwnerUserId, DATEPART(WEEK, CreationDate)
ORDER BY WeekNumber;

Enter Parameters

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