Most evil users

0

Please login or register to vote for this query.

(click on this box to dismiss)

Users with highest downvote to upvote ratio.

Code Review

Q&A for peer programmer code reviews

select top 100
  row_number() over (order by u.DownVotes * 1.0 / u.UpVotes desc),
  u.Id as [User Link],
  format(u.DownVotes * 1.0 / UpVotes, 'p') as Ratio,
  u.UpVotes,
  u.DownVotes,
  u.Reputation,
  u.LastAccessDate,
  (
    select top 3
      t.TagName + ', ' as 'data()'
    from
      Posts as p
    inner join
      PostTags as pt on pt.PostId = p.Id
    inner join
      Tags as t on pt.TagId = t.Id
    where
      p.OwnerUserId = u.Id
    for xml path('')
  ) as TopTags
from
  Users as u
where
  u.DownVotes + u.UpVotes > 100
group by
  u.Id, u.UpVotes, u.DownVotes, u.Reputation, u.LastAccessDate
order by
  u.DownVotes * 1.0 / u.UpVotes desc

Enter Parameters

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