Upvotes for question by month

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT    
    DATENAME(MM, p.CreationDate) AS Month, DATENAME(YYYY, p.CreationDate) AS Year,
    Count(*) AS Amount
FROM
    Votes v JOIN Posts p ON v.PostId=p.Id
WHERE
    p.Id = 21297970 AND VoteTypeId In (2,3)
GROUP BY
    DATENAME(MM, p.CreationDate), DATENAME(YYYY, p.CreationDate)
ORDER BY
    DATENAME(MM, p.CreationDate), DATENAME(YYYY, p.CreationDate)

Enter Parameters

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