SELECT u.Id AS UserID, CAST(u.CreationDate AS DATE) AS Us...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Anime and Manga

Q&A for anime and manga fans

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;

Enter Parameters

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