IFNULL
Selects the first argument when it is not null; otherwise uses the second argument.
Category: Utility Functions
Syntax
IFNULL(value, default)Arguments
- value
anyA branch value. All branches must share one blendable family — all BOOLEAN, all string, or a numeric/temporal scalar mix. DECIMAL is not blendable; CAST it to DOUBLE first. - default
anyA branch value. All branches must share one blendable family — all BOOLEAN, all string, or a numeric/temporal scalar mix. DECIMAL is not blendable; CAST it to DOUBLE first.
Returns
compatible input type — Returns either the primary value or the fallback value using a type compatible with both arguments.