Min, max, and average of score to view count ratios per question over a given year

0

Please login or register to vote for this query.

(click on this box to dismiss)

thanks to http://data.stackexchange.com/stackoverflow/s/1506/average-answer-score

Mythology Meta

Q&A about the site for enthusiasts and scholars of mythology and folklore

-- Min, max, and average of score to view count ratios per question over a given year
-- thanks to http://data.stackexchange.com/stackoverflow/s/1506/average-answer-score

SELECT
MIN(cast(Score as decimal)/cast(viewcount as decimal)) AS "Minimum",
MAX(cast(Score as decimal)/cast(viewcount as decimal)) AS "Maximum",
(SUM(cast(Score as decimal)/cast(viewcount as decimal)) + 0.0) / Count(*) AS "Average"

FROM posts

WHERE
creationdate >= cast(##year:int## as char) + '-01-01'
and creationdate < cast((##year:int## + 1) as char) + '-01-01'
and posttypeid = 1

Enter Parameters

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