How does the SUM() function behave when applied to a column with NULL values in DB2?

  • It ignores NULL values
  • It replaces NULL with 0
  • It returns NULL
  • It throws an error
The SUM() function in DB2 behaves by ignoring NULL values when applied to a column. It calculates the sum of all non-null values in the specified column. This behavior is important to understand when dealing with numerical data in DB2 queries, as it ensures that NULL values do not affect the calculation of sums. 
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *