Skip to main content

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

NVL example
SELECT NVL(NULL, 2)
-- 2
NVL example
SELECT NVL(5, 2)
-- 5