NVL (Lakehouse v1)
Si <expr1> est NULL, renvoie <expr2> ; sinon, renvoie <expr1>.
Syntaxe Analyze
Section intitulée « Syntaxe Analyze »func.nvl(<expr1>, <expr2>)Exemples Analyze
Section intitulée « Exemples Analyze »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 │└────────────────────────────────────┘Syntaxe SQL
Section intitulée « Syntaxe SQL »NVL(<expr1>, <expr2>)Exemples SQL
Section intitulée « Exemples SQL »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 │└──────────────────────────┘