Msg 467, Level 16, State 1, Line 4GROUP BY, HAVING, or aggregate functions are not allowed in the recursive part of a recursive common table expression ‘<CTENAME>’.
WHy!? Why can I not use sum() in a recursive table expression? Yes it would suck if you told it to run something ridiculous but this is easy. It’s not going to crash anything regardless of how complicated the sum() is. Oye.