Ration of Question Score to Question Views

3

Please login or register to vote for this query.

(click on this box to dismiss)

Ratio of votes to views and vote type information for questions posted since Jan 1, 2011; sorted primarily by the votes to views ratio. (I'll try to edit it later to sum up the different vote types, so that there's only one entry per question.)

Stack Overflow

Q&A for professional and enthusiast programmers

-- Ration of Question Score to Question Views
-- Ratio of votes to views and vote type information
-- for questions posted since Jan 1, 2011;
-- sorted primarily by the votes to views ratio.
-- (I'll try to edit it later to sum up the different vote types,
-- so that there's only one entry per question.)

SELECT
  [Post Link] = p.Id, -- duh, make it magic!
  SVRatio = round(cast(p.Score as float)/cast(p.ViewCount as float),4),
  p.Score,
  Views = p.ViewCount,
  "V Type" = vt.Name,
  p.CreationDate 

FROM Posts p
JOIN Votes v
ON p.Id = v.PostID
JOIN VoteTypes vt
ON v.VoteTypeID = vt.Id

WHERE 
  p.PostTypeId = 1
AND
  ViewCount > 0
AND
   p.CreationDate > '2011-01-01'

ORDER BY 
SVRatio DESC,
p.CreationDate,
vt.Name

Enter Parameters

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