SELECT Posts.Id , SUM( CASE WHEN Votes.VoteTypeId = 2 THE...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Meta Stack Exchange

Q&A for meta-discussion of the Stack Exchange family of Q&A websites

SELECT
Posts.Id
, SUM( CASE WHEN Votes.VoteTypeId = 2 THEN 1 ELSE 0 END ) UpVotes
, SUM( CASE WHEN Votes.VoteTypeId = 3 THEN 1 ELSE 0 END ) DownVotes
, Posts.ClosedDate
FROM
Posts
, Votes
WHERE
Posts.PostTypeId = 1
AND Posts.Score <= -20
AND Votes.PostId = Posts.Id
AND Votes.VoteTypeId IN (2, 3)
GROUP BY
Posts.Id
, Posts.ClosedDate

Enter Parameters

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