When to ask for maximum visibility

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

-- When to ask for maximum visibilty
-- "Visibility" meaning votes, views, etc.
-- Views / 100 because otherwise numbers were too big and made the graph ugly
-- Credit to http://data.stackexchange.com/stackoverflow/query/17321/
--   for teaching me how to SQL

SELECT
  DATEPART(hour, CreationDate) AS hour,
  CAST(SUM(Score) AS FLOAT) / COUNT(Score) AS avgScore,
  CAST(SUM(ViewCount) AS FLOAT) / COUNT(ViewCount) / 100 AS avg100Views,
  CAST(SUM(AnswerCount) AS FLOAT) / COUNT(AnswerCount) AS avgAnswers
FROM Posts
WHERE
  PostTypeId = 1
GROUP BY DATEPART(hour, CreationDate)
ORDER BY hour

Enter Parameters

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