My Downvoted Answers

1

Please login or register to vote for this query.

(click on this box to dismiss)

Sports

Q&A for participants in team and individual sport activities

SELECT CONCAT('site://a/', a.Id, '/timeline|', q.Title) AS [Link]
     , CONCAT('+', COUNT(CASE WHEN v.VoteTypeId = 2 THEN 1 END), ' / -', COUNT(CASE WHEN v.VoteTypeId = 3 THEN 1 END), CASE WHEN COUNT(CASE WHEN v.VoteTypeId = 1 THEN 1 END) > 0 THEN ', accepted' END) AS Summary
     , a.Score
     , COUNT(CASE WHEN v.VoteTypeId = 1 THEN 1 END) AS UpVotes
     , COUNT(CASE WHEN v.VoteTypeId = 3 THEN 1 END) AS DownVotes
FROM Posts AS a
JOIN Posts AS q ON a.ParentId = q.Id
JOIN Votes AS v ON a.Id = v.PostId
WHERE a.OwnerUserId = ##UserId## AND a.PostTypeId = 2
GROUP BY a.Id, a.Score, q.Title
HAVING COUNT(CASE WHEN v.VoteTypeId = 3 THEN 1 END) > 0
ORDER BY a.Id

Enter Parameters

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