Aggregate Days since post creation that a vote was cast

0

Please login or register to vote for this query.

(click on this box to dismiss)

Statistical Analysis

Q&A for people interested in statistics, machine learning, data analysis, data mining, and data visualization

SELECT
	DATEDIFF(day,Posts.CreationDate,Votes.CreationDate) AS DayVote,
    COUNT(*) AS TotalN
FROM Votes
    INNER JOIN Posts ON Votes.PostId = Posts.Id    
WHERE
    (VoteTypeId = 2 OR VoteTypeId = 3)
GROUP BY DATEDIFF(day,Posts.CreationDate,Votes.CreationDate)
ORDER BY DayVote

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results