if_null

Description

Return the second argument if the first argument has the null value. Arguments must have the same type.

Return type

least common generalization skipping variants

Domain

This is a scalar function (calculates a single output value for a single input row.)

Categories

Usage

if_null( arg, replacement )

Argument

Type

Required

Multiple

arg

variant

Required

Only one

replacement

variant

Required

Only one

Examples

make_col foo:if_null(foo, 0)

Replace the value of column ‘foo’ with the value 0 if the value is null.

Aliases

ifnull (deprecated)