NVL2
Purpose
This function replaces NULL values with expr3, otherwise it uses expr2.
Syntax
nvl2::=
Usage Notes
- If
expr1isNULL, thenexpr3is returned, otherwiseexpr2is returned. - The abbreviation NVL stands for "Null Value".
- If there is no legal type conversion between
expr2andexpr3, then the function returns an error. - For additional information, see NVL.
Example
SELECT NVL2(NULL, 2, 3) NVL_1,
NVL2(1, 2, 3) NVL_2;
Result
| NVL_1 | NVL_2 |
| 3 | 2 |