Top downvoters with downvote percentage

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

Declare @MinDownvotes int = ##MinDownvotes##

SELECT
    ROW_NUMBER() OVER(ORDER BY u.Downvotes DESC) AS rnum
  , u.Id
  , u.Reputation
  , u.CreationDate
  , u.DisplayName
  , u.LastAccessDate
  , u.UpVotes
  , u.Downvotes
  , CONVERT(
        decimal(10,2)
      , CONVERT(
            decimal(10,2)
          , u.Downvotes
        ) /
        CONVERT(
            decimal(10,2)
          , u.Upvotes+u.Downvotes
        ) * 100
    ) AS pct_d
FROM
    Users u
WHERE
    u.Downvotes > @MinDownvotes
ORDER BY
    u.Downvotes DESC

Enter Parameters

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