Average score per hundred views

1

Please login or register to vote for this query.

(click on this box to dismiss)

Raspberry Pi

Q&A for users and developers of hardware and software for Raspberry Pi

;with counts_cte AS 
(SELECT eomonth(p.CreationDate) AS Cmonth,
  SUM(Score) AS Score,
  SUM(ViewCount) AS Views
FROM Posts p
WHERE PostTypeId=1
GROUP BY eomonth(p.CreationDate)
)

SELECT
  Cmonth,
  100*(CAST(Score AS decimal))/(CAST(Views AS decimal)) AS [Score per view]
FROM counts_cte
ORDER BY Cmonth

Enter Parameters

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