SELECT SUM(CASE v.VoteTypeId WHEN 2 THEN 1 ELSE 0 END) AS...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

SELECT
  SUM(CASE v.VoteTypeId WHEN 2 THEN 1 ELSE 0 END) AS UpVotes,
  SUM(CASE v.VoteTypeId WHEN 3 THEN 1 ELSE 0 END) AS DownVotes,
  v.CreationDate
FROM
  Votes v 
  INNER JOIN PostTags t ON v.PostId = t.PostId
  INNER JOIN Tags g ON g.Id = t.TagId
WHERE
  g.TagName = 'angularjs' AND
  (v.VoteTypeId = 2 OR v.VoteTypeId = 3)
GROUP BY
  v.CreationDate
ORDER BY
  v.CreationDate ASC

Enter Parameters

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