NVL2 (Lakehouse v1)
Devuelve <expr2> si <expr1> no es NULL; de lo contrario, devuelve <expr3>.
Sintaxis de Analyze
Sección titulada «Sintaxis de Analyze»func.nvl2(<expr1> , <expr2> , <expr3>)Ejemplos de Analyze
Sección titulada «Ejemplos de Analyze»func.nvl2('a', 'b', 'c'), func.nvl2(null, 'b', 'c')
┌──────────────────────────────────────────────────────┐│ func.nvl2('a', 'b', 'c') │ func.nvl2(null, 'b', 'c') │├──────────────────────────┼───────────────────────────┤│ b │ c │└──────────────────────────────────────────────────────┘
func.nvl2(1, 2, 3), func.nvl2(null, 2, 3)
┌────────────────────────────────────────────┐│ func.nvl2(1, 2, 3) │ func.nvl2(null, 2, 3) │├────────────────────┼───────────────────────┤│ 2 │ 3 │└────────────────────────────────────────────┘Sintaxis de SQL
Sección titulada «Sintaxis de SQL»NVL2(<expr1> , <expr2> , <expr3>)Ejemplos de SQL
Sección titulada «Ejemplos de SQL»SELECT NVL2('a', 'b', 'c'), NVL2(NULL, 'b', 'c');
┌────────────────────────────────────────────┐│ nvl2('a', 'b', 'c') │ nvl2(null, 'b', 'c') │├─────────────────────┼──────────────────────┤│ b │ c │└────────────────────────────────────────────┘
SELECT NVL2(1, 2, 3), NVL2(NULL, 2, 3);
┌──────────────────────────────────┐│ nvl2(1, 2, 3) │ nvl2(null, 2, 3) │├───────────────┼──────────────────┤│ 2 │ 3 │└──────────────────────────────────┘