Percentage of votes - depending on day after posting (only questions)

1

Please login or register to vote for this query.

(click on this box to dismiss)

Blender Meta

Q&A about the site for people who use Blender to create 3D graphics, animations, or games

SELECT
  DATEDIFF(day, p.CreationDate, v.CreationDate) AS Days,
  COUNT(v.Id) AS Count,
  COUNT(v.Id) * 100.0 / SUM(COUNT(v.Id)) OVER () AS Percentage
---see: https://stackoverflow.com/questions/46909494/percentage-from-total-sum-after-group-by-sql-server
FROM Votes v INNER JOIN Posts p ON v.PostId=p.Id
WHERE p.PostTypeId=1
----only questions
GROUP BY DATEDIFF(day, p.CreationDate, v.CreationDate)
ORDER BY DATEDIFF(day, p.CreationDate, v.CreationDate)

Enter Parameters

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