How to: |
Given a list of arguments, COALESCE returns the value of the first argument that is not missing. If all argument values are missing, it returns a missing value if MISSING is ON. Otherwise it returns a default value (zero or blank).
COALESCE(arg1, arg2, ...)
where:
Any field, expression, or constant. The arguments should all be either numeric or alphanumeric.
Are the input parameters that are tested for missing values.
The output data type is the same as the input data types.
COALESCE returns the first non-missing value:
COALESCE(DAMAGED, RETURNS)
The following table shows sample inputs and results.
DAMAGED |
RETURNS |
RESULT |
---|---|---|
MISSING |
4 |
4 |
6 |
4 |
6 |
WebFOCUS | |
Feedback |