Data 360 SQL and Tableau Hyper API
Type Conversions
Logical Operators
CASE
COALESCE
GREATEST and LEAST
IFF
NULLIF
NULLIFZERO
NVL and IFNULL
ZEROIFNULL
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
NVL and IFNULLApplies to: ✅ Data 360 SQL ✅ Tableau Hyper API
IFNULL and NVL both return a replacement expression when the input expression is NULL.
1nvl(<expr>, <replacement>)
2ifnull(<expr>, <replacement>)<expr>: Expression to check for NULL.<replacement>: Expression returned when <expr> is NULL.Returns <expr> when it isn’t NULL; otherwise, returns <replacement>. Argument types must be compatible.
IFNULL is an alias of NVL.COALESCE with these two arguments.Return the replacement when the first expression is NULL.
1SELECT nvl(NULL, 99) AS result;Returns 99.
IFNULL returns the same result:
1SELECT ifnull(NULL, 99) AS result;Returns 99.
Return the first expression when it isn’t NULL.
1SELECT nvl(42, 0) AS result;Returns 42.