Skip to main content
Version: 0.0.1

NVL

Categories: Conditional

NVL

Returns the value of the first expression, if it is not NULL. Otherwise, returns the value of the second expression.

Syntax

NVL(expression1, expression2) → same as input type

  • expression1: The expression can be any data type, however, both expressions contained in the argument must be of the same type.
  • expression2: The expression can be any data type, however, both expressions contained in the argument must be of the same type.

Examples

{{< codeheader "NVL example" >}}

SELECT NVL(NULL, 2)
-- 2

{{< codeheader "NVL example" >}}

SELECT NVL(5, 2)
-- 5