NVL (Lakehouse v1)
Se <expr1> for NULL, retorna <expr2>; caso contrário, retorna <expr1>.
Sintaxe do Analyze
Seção intitulada “Sintaxe do Analyze”func.nvl(<expr1>, <expr2>)Exemplos do Analyze
Seção intitulada “Exemplos do 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 │└────────────────────────────────────┘Sintaxe SQL
Seção intitulada “Sintaxe SQL”NVL(<expr1>, <expr2>)Aliases
Seção intitulada “Aliases”Exemplos de SQL
Seção intitulada “Exemplos de 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 │└──────────────────────────┘