Plots quartiles of the answer score distribution as a function of answer length.
Q&A about the site for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure
WITH AllQuartiles(RoundedLength,PostScore,Quartile) AS ( SELECT TOP(1000000000) (ROUND(LEN(Body), -##logRound?3##) +0.5E##logRound?3##) AS RoundedLength, Score AS PostScore, NTILE(4) OVER(PARTITION BY ROUND(LEN(Body), -##logRound?3##) ORDER BY Score) AS Quartile FROM Posts WHERE PostTypeId = 2 AND LEN(Body) <= 12000 ORDER BY ROUND(LEN(Body), -##logRound?3##),Score ) SELECT RoundedLength--MAX(PostScore) FROM AllQuartiles WHERE Quartile!=4 GROUP BY RoundedLength,Quartile ORDER BY RoundedLength