Answers Per User for One Week

0

Please login or register to vote for this query.

(click on this box to dismiss)

Operations Research Meta

Q&A about the site for operations research and analytics professionals, educators, and students

WITH a AS (

SELECT 
u.id AS user_id
, COUNT(DISTINCT p.id) AS posts
FROM Users u
LEFT JOIN Posts p ON p.OwnerUserId = u.id AND p.PostTypeId = 2 AND (p.CreationDate>='2023-04-08' AND p.CreationDate<'2023-04-15')
GROUP BY u.id
) 
, total AS (
SELECT COUNT(DISTINCT u.id) AS users
FROM Users u
)
SELECT 
COUNT(DISTINCT user_id) AS users
, posts


FROM a
GROUP BY posts

Enter Parameters

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