Declaration
NVL(str1,replace_with)
Description
Replaces NULL values with a specified value. If str1 is NULL, the function returns the value specified by replace_with. Here, str1 typically refers to a column name. replace_with can be a direct value (hardcoded), a reference to another column, or an expression.
This ability to automatically replace NULL values provides a more complete output.
Examples
obclient> SELECT NVL(NULL, 0), NVL(NULL, 'a');
+--------------+----------------+
| NVL(NULL, 0) | NVL(NULL, 'a') |
+--------------+----------------+
| 0 | a |
+--------------+----------------+
1 row in set