Post Score/View ratio - top 20 most valuable posts

0

Please login or register to vote for this query.

(click on this box to dismiss)

Returns 20 question posts with the highest Score/View ratio, (arguably) being a measure of the post quality (as opposed to - popularity).

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @MinScore int = ##MinScore##
DECLARE @MinViews int = ##MinViews##
-- Just to avoid very high SVRatio (sometimes 1) for new questions
-- Setting min values drastically changes the results, as perhaps
-- there is a power law relation of Score/Views, not a linear relation

SELECT TOP 20
  P.Id as [Post Link],
  CAST(P.Score AS FLOAT) / CAST(P.ViewCount AS FLOAT) SVRatio,
  P.Score Score,
  P.ViewCount Views,
  P.CreationDate CreationDate
FROM
  Posts P
WHERE
  P.PostTypeId = 1 -- only question posts
  AND P.Score >= @MinScore
  AND P.ViewCount >= @MinViews
ORDER BY
  SVRatio DESC

Enter Parameters

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