Outscored answer has 4+ more downvotes than accepted answer


Please login or register to vote for this query.

(click on this box to dismiss)


Q&A for people looking to bypass life's everyday problems with simple tricks

with controversial as  --- simply a downvote count table with nulls for 0 dv
PostId, count(*) as downvotes
    from Votes where VoteTypeId  = 3 group by PostId

distinct q.Id as [Post Link], 
aac.downvotes as 'aa dv',
hsc.downvotes as 'hs dv',
hsc.downvotes - aac.downvotes as controversialHS

Posts as q 
left join Posts as aa on q.Id = aa.ParentId --- aa: accepted answer
left join Posts as hs on q.Id = hs.ParentId --- hs: highest scoring answer
left join controversial as aac on aa.Id = aac.PostId --- aac: accepted answer controversy
left join controversial as hsc on hs.Id = hsc.PostId --- hsc: higest scoring answer controversy
q.PostTypeId = 1 and
q.AcceptedAnswerId is not null and
q.AnswerCount > 1 and
hsc.downvotes - aac.downvotes > 3 and --- hs has more DVs than aa
aa.Score < hs.Score and --- aa has lower score, ordering will change
aa.Id = q.AcceptedAnswerId and
hs.Score = (Select max(score) from Posts csq where csq.ParentId = q.id)
order by controversialHS DESC;

Enter Parameters

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