handling of (indirect) division by zero: nulls or an error?
I posted earlier about a problem with 'type mismatch' being reported. The root cause is quite simple: it is returned if the stddev_pop() function is used in a select that returns zero rows. Given that the count of the population (N) is used as the denominator in the calculation this makes sense. A question arising then is this. If one has assembled a more complex list of aggregate functions in a query, would it be better for null to be returned instead of an error? i.e. select count(weight), sum(weight), average(weight) where (no rows are selected) => 0,null,null Should this not also be the case if stddev_pop is included? select count(weight), sum(weight), average(weight), stddev_pop(weight) where (no rows are selected) => 0,null,null,null Instead of 'type mismatch' ? TIA. J.
participants (1)
-
g4@novadsp.com