weekly anylise

0

Please login or register to vote for this query.

(click on this box to dismiss)

Lifehacks

Q&A for people looking to bypass life's everyday problems with simple tricks

SELECT
    DATEPART(YEAR, Posts.CreationDate) AS Year,
    DATEPART(WEEK, Posts.CreationDate) AS Week,
    COUNT(*) AS PostCount,
    AVG(Posts.Score) AS AverageScore,
    SUM(Posts.ViewCount) AS TotalViewCount
FROM
    Posts
WHERE
    Posts.CreationDate >= '2022-01-01'
    AND Posts.CreationDate < '2023-02-01'
GROUP BY
    DATEPART(YEAR, Posts.CreationDate),
    DATEPART(WEEK, Posts.CreationDate)
ORDER BY
    Year, Week

Enter Parameters

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