Accepted vs. Top difference


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select distinct top 150 a.Id as [Post Link],
oa.score - a.score as 'Score Difference',
a.score as 'Accepted Score'
from Posts q
inner join Posts a
  on q.Id = a.ParentId
  and q.OwnerUserId <> a.OwnerUserId
  and q.AcceptedAnswerId = a.Id
inner join Posts oa
  on q.Id = oa.ParentId
  and a.Id <> oa.Id
  and q.OwnerUserId <> oa.OwnerUserId
where q.PostTypeId = 1
  and oa.score - a.score > 4
  and a.Score < oa.Score
order by oa.score - a.Score desc;

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results