How does the AVG() function handle NULL values in DB2?

  • AVG() function ignores NULL values during the calculation.
  • AVG() function returns NULL if any value in the set is NULL.
  • AVG() function treats NULL values as missing data and excludes them from the calculation.
  • AVG() function treats NULL values as zero during the calculation.
The AVG() function in DB2 calculates the average of a set of values in a column. When NULL values are encountered, the AVG() function ignores them during the calculation, effectively treating them as missing data and excluding them from the average calculation. Therefore, NULL values do not contribute to the sum of values divided by the count of non-NULL values. 
Add your answer
Loading...

Leave a comment

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