August 2002
Intermediate to advanced
528 pages
10h 12m
English
The NVL function is used to replace a null value with another value. It can be used with numeric and non-numeric data type values. It is an extremely important function if the AVG group function is used in the query. The AVG function will calculate incorrect averages if the target set of values contains nulls because null values do not equal 0 and will not be included in the divisor as a 0 value would. The divisor of a set of values that has values of 0 will be larger than a comparable set that contains nulls instead of 0s.
The NVL function can be used to overcome this problem. This function can replace null values with a value of 0 (or any other value), which will cause the divisor to increase and correct ...