Getting downvoters for a post

0

Please login or register to vote for this query.

(click on this box to dismiss)

The query shall fetch down voters to a post.

Android Enthusiasts Meta

Q&A about the site for enthusiasts and power users of the Android operating system

DECLARE @postID INT = ##PostID##

SELECT *
--  p.Id,
--  v.UserID,
--  u.DisplayName AS [Name],
--  CASE v.VoteTypeId 
--    WHEN 2 THEN 'Upvote'
--    WHEN 3 THEN 'Downvote'
--  END AS [Vote Type]
FROM Votes
JOIN VoteTypes ON Votes.VoteTypeId=VoteTypes.Id
WHERE Votes.PostId = @postID;

Enter Parameters

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