Trying to understand the CASE
(Transact-SQL) expression, but ended up with lot of confusion. Can anyone please explain the following statement in simple words?
CASE SUM(total_of_A) WHEN 0 THEN 0 ELSE SUM(B) / SUM(total_of_A) END;
I read the following, but it doesn't clear up the confusion
CASE input_expression
WHEN when_expression THEN result_expression [ ...n ]
[ELSE else_result_expression ]
END