Is there any difference between writing :
select
...,
mySum= CASE
WHEN i IS NULL THEN 0 ELSE SUM(i)
END
...
vs
select
...,
mySum= SUM( CASE WHEN i IS NULL THEN 0 ELSE i
END
)
...
Or is it just 100% the same ( logically and traps…)?
On my test data, I get the same results returned, and near identical execution plans:
All the same costs, just two operations reversed.