Post Score/View ratio for a given user

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

DECLARE @MinScore int = ##MinScore##
DECLARE @MinViews int = ##MinViews##

SELECT 
  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.OwnerUserId = ##userid##
  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