WITH c AS ( SELECT Posts.Id AS PostId, Votes.CreationDat...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Chess Meta

Q&A about the site for serious players and enthusiasts of chess

-- Enter Query Title
-- Enter Query Description

WITH c AS
(
    SELECT
        Posts.Id AS PostId,
        Votes.CreationDate AS VoteCreationDate,
        DATEPART(dw, Votes.CreationDate) AS Day
        FROM Posts
        INNER JOIN Votes ON Votes.PostId = Posts.Id
        WHERE Votes.VoteTypeId = 1
)
SELECT
    DATENAME(dw, VoteCreationDate) AS Day,
    COUNT(*) OVER(PARTITION BY Day) AS Count
    FROM c
    GROUP BY Day, VoteCreationDate
    ORDER BY Day

Enter Parameters

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