Score per post, grouped by post length (in increments of 500) Enter 1 for Questions, 2 for Answers, 1,2 for both
Q&A about the site for people looking to bypass life's everyday problems with simple tricks
-- Best Scoring Post Lengths -- Score per post, grouped by post length (in increments of 500) SELECT FLOOR(LEN(Body)/500) * 500 AS [Post Length], SUM(Score) AS [Total Score], COUNT(Id) AS [Num of Posts], CAST(SUM(Score) AS FLOAT) / COUNT(Id) AS [Score Per Post] FROM Posts WHERE PostTypeId IN (##PostTypes##) GROUP BY FLOOR(LEN(Body)/500) * 500 ORDER BY [Post Length] DESC