Q&A for programmers
With Cte as ( SELECT SUM (CASE WHEN SCORE < 0 THEN 1 ELSE 0 END) NegativePost, SUM (CASE WHEN SCORE = 0 THEN 1 ELSE 0 END) ZeroPointPost, SUM (CASE WHEN SCORE > 0 THEN 1 ELSE 0 END) PositivePost, COUNT (ID) PostCount, CAST(SUM (CASE WHEN SCORE < 0 THEN 1 ELSE 0 END) AS DECIMAL) / Count(Id) NegativePostRate, OwnerUserID FROM Posts WHERE OwnerUserID <> -1 --Community user GROUP BY OwnerUserID HAVING COUNT (ID) > 100) SELECT RANK() OVER (ORDER BY NegativePostRate DESC) Rank, OwnerUserID [User Link], NegativePost, ZeroPointPost, PositivePost, PostCount, NegativePostRate FROM cte ORDER BY NegativePostRate DESC
Error: looks like you typed in the wrong words - try again