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.

Chess

Q&A for serious players and enthusiasts of chess

DECLARE @postID INT = ##PostID##

SELECT
  Id AS [Post Link],
  Title
FROM Posts
WHERE Id = @postID;

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

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results