select Q.id as [Post Link], Q.score as QScore, max(A.scor...

0

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
  Q.id as [Post Link],
  Q.score as QScore,
  max(A.score) as AScore

from posts Q
  join posts A on Q.id = A.parentid
where
  Q.score < 0 and A.score > 10
  and Q.ClosedDate is not null
group by Q.id, Q.score
order by max(A.score) - Q.score DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results