NVL2
Return values based on NULL status. This function returns the second argument if the first is not NULL, and the third argument if the first is NULL.
Syntax
NVL2(expr1,expr2,expr3)Description
Examples
SELECT NVL2(NULL,1,2);
+----------------+
| NVL2(NULL,1,2) |
+----------------+
| 2 |
+----------------+
SELECT NVL2('x',1,2);
+---------------+
| NVL2('x',1,2) |
+---------------+
| 1 |
+---------------+See Also
Last updated
Was this helpful?

