Question and accepted answer vote difference, where Q > A

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

-- finds Q's with an accepted,
-- where UVs on Q > UVs on A
-- gives difference in tallies above stated threshold
--
-- ** Last "and" filters out Accepted answers with score over set threshold,
--    so remove to see all cases, or adjust threshold:
--       : higher n includes more answers;
--       : lower n excludes more answers.

-- aScoreThreshold: Set whole number (+/-) value to filter accepted answer score, higher numbers give more results.
-- Thanks PV :)

SELECT DISTINCT TOP 300 Q.Id as [Post Link],
  Q.Score as qScore,
  A.Score as aScore,
  Q.Score - A.Score as scoreDiff

FROM Posts Q, Posts A, Posts OA 

WHERE A.ParentId = Q.Id
  AND A.Id = Q.AcceptedAnswerId
  AND A.Score < Q.Score
  and Q.Score - A.Score >= ##diffThreshold##

Enter Parameters

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