ifNull
Returns one of two expressions depending on whether one of the expressions is NULL.
Syntax
ifNull(string expr str1, string expr str2)
- str1: expression to check for a NULL value
- str2: expression to return if str1 is NULL
Both expr1 and expr2 evaluate to string
, date
or timestamp
.
Returns
string
, date
or timestamp
Description
ifNull
checks whether str1 evaluates to NULL. If it does not evaluate to NULL, it returns str1. If it does evaluate to NULL it returns str2.