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 Date, Count(*) AS Amount
  FROM ( 
    SELECT  
        DATEFROMPARTS(DATEPART(YYYY, v.CreationDate), DATEPART(MM, v.CreationDate), 1) AS Date
        
    FROM
        Votes v JOIN Posts p ON v.PostId=p.Id
    WHERE p.Id = 21297970 AND VoteTypeId In (2,3)
  ) AS Q
GROUP BY Date
ORDER BY Date

Enter Parameters

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