NVL (Lakehouse v1)
If <expr1> is NULL, returns <expr2>, otherwise returns <expr1>.
Analyze Syntax
Section titled “Analyze Syntax”func.nvl(<expr1>, <expr2>)Analyze Examples
Section titled “Analyze Examples”func.nvl(null, 'b'), func.nvl('a', 'b')
┌──────────────────────────────────────────┐│ func.nvl(null, 'b') │ func.nvl('a', 'b') │├─────────────────────┼────────────────────┤│ b │ a │└──────────────────────────────────────────┘
func.nvl(null, 2), func.nvl(1, 2)
┌────────────────────────────────────┐│ func.nvl(null, 2) │ func.nvl(1, 2) │├───────────────────┼────────────────┤│ 2 │ 1 │└────────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”NVL(<expr1>, <expr2>)Aliases
Section titled “Aliases”SQL Examples
Section titled “SQL Examples”SELECT NVL(NULL, 'b'), NVL('a', 'b');
┌────────────────────────────────┐│ nvl(null, 'b') │ nvl('a', 'b') │├────────────────┼───────────────┤│ b │ a │└────────────────────────────────┘
SELECT NVL(NULL, 2), NVL(1, 2);
┌──────────────────────────┐│ nvl(null, 2) │ nvl(1, 2) │├──────────────┼───────────┤│ 2 │ 1 │└──────────────────────────┘