ifnull
function
Applies to: Databricks SQL Databricks Runtime
Returns expr2
if expr1
is NULL
, or expr1
otherwise. This function is a synonym for coalesce(expr1, expr2)
with two arguments.
Syntax
ifnull(expr1, expr2)
Arguments
expr1
: An expression of any type.expr2
: An expression sharing a least common type withexpr1
.
Returns
The result type is the least common type of expr1
and expr2
.
Examples
> SELECT ifnull(NULL, array('2'));
[2]
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for