Find most disputed posts

1

Please login or register to vote for this query.

(click on this box to dismiss)

Finds posts that have a large amount of upvotes and downvotes.

Music Fans Meta

Q&A about the site for music historians, critics, and fans

;with UpvotedPosts as
(
  select
    p.Id,
    count(P.Id) [UpvoteCount]
  from Posts p
  inner join Votes v on v.PostId = p.Id
    and v.VoteTypeId = 2 --UpMod
  group by p.Id
  having count(p.Id) >= ##minUpvoteCount:int##
),
DownvotedPosts as
(
  select
    p.Id,
    count(P.Id) [DownvoteCount]
  from Posts p
  inner join Votes v on v.PostId = p.Id
    and v.VoteTypeId = 3 --DownMod
  group by p.Id
  having count(p.Id) >= ##minDownvoteCount:int##
)
select 
  p.Id [Post Link],
  up.UpvoteCount,
  dp.DownvoteCount,
  abs(up.UpvoteCount - dp.DownvoteCount) [delta],
  up.UpvoteCount + dp.DownvoteCount [sum]
from Posts p
inner join UpvotedPosts up on p.Id = up.Id
inner join DownvotedPosts dp on p.Id = dp.Id
order by delta asc, [sum] desc

Enter Parameters

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