COALESCE
Returns the first value in a given list that is not null
.
Syntax
Arguments
VALUE
VALUE
Type: any
A list of values of any type.
Returns
Type: same as input
The first VALUE
that is not null
.
Examples
Transformation job example
SQL
Query result
coalesce_example1
coalesce_example2
coalesce_example3
3.4
a
2022-08-14
Example with arrays
SQL
Query result
coalesce_example1
coalesce_example2
coalesce_example3
[1.1, 0.2]
[1.1, 0.2]
[1.1, 0.2]
In arrays containing null and non-null values, Upsolver ignores null values when working with the array. For example, the first array in coalesce_example2
is not considered a null value.
Conversely, an array containing only null values is considered null
, so coalesce_example3
returns the second array provided.
Last updated