Outscored answer more downvotes than accepted answer

0

Please login or register to vote for this query.

(click on this box to dismiss)

Reverse Engineering Meta

Q&A about the site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation

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

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

from 
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
where 
q.PostTypeId = 1 and
q.AcceptedAnswerId is not null and
q.AnswerCount > 1 and
hsc.downvotes - aac.downvotes > 0 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

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