Q&A for Data science professionals, Machine Learning specialists, and those interested in learning more about the field
SELECT u.Id AS UserID, CAST(u.CreationDate AS DATE) AS UserCreateDate, MIN(p.CreationDate) AS JanuaryFirstPostDate, MAX(p.CreationDate) AS JanuaryLastPostDate, COUNT(p.Id) AS PostsInJanuary FROM Users u JOIN Posts p ON u.Id = p.OwnerUserId WHERE CAST(u.CreationDate AS DATE) = '2021-12-23' AND p.CreationDate >= '2022-01-01' AND p.CreationDate < '2022-02-01' GROUP BY u.Id, CAST(u.CreationDate AS DATE) ORDER BY COUNT(p.Id) DESC;