HPL/SQL is included to Apache Hive since version 2.0
HPL/SQL is included to Apache Hive since version 2.0
If the first expression is NOT NULL, NVL2 function returns the result of the second expression, otherwise it returns the result of the third expression.
Syntax:
NVL2(expr1, expr2, expr3);
Parameters:
Parameter | Type | Value |
exprN | Any | Variable or expression |
Notes:
Return Type:
The data type of the returned expression by expr2 or expr3 depending whether expr1 is NULL or not.
Example 1:
NVL2(NULL, 1, 2);
Result: 2
Compatibility: Oracle and IBM DB2.
Version: PL/HQL 0.01