May 13, 2020 at 10:37 am
The column [hrsfacil] contains many NULL values, still the sum of [hrsfacil] is correct using the OVER clause. Why don't I need to use ISNULL(hrsfacil,0) ?
Cheers,
Julian
SUM([hrsfacil]) OVER() AS Facil
May 13, 2020 at 10:52 am
From the documentation (emphasis mine):
Returns the sum of all the values, or only the DISTINCT values, in the expression. SUM can be used with numeric columns only. Null values are ignored.
John
May 13, 2020 at 10:58 am
Great, thank you John!
J.
May 13, 2020 at 4:28 pm
question is also, why is NULL allowed? Is that an issue that needs addressed so that the SUM is actually correct data? Simply because it handles the situation doesn't mean that it is not a problem for someone.
-------------------------------------------------------------------------------------------------------------------------------------
Please follow Best Practices For Posting On Forums to receive quicker and higher quality responses
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply