- Catégories :
NVL¶
Si expr1
vaut NULL, renvoie expr2
, sinon renvoie expr1
.
- Alias
Syntaxe¶
NVL( <expr1> , <expr2> )
Arguments¶
expr1
L’expression à vérifier pour savoir s’il s’agit de NULL.
expr2
Si
expr1
est NULL, cette expression est évaluée et sa valeur est renvoyée.
Détails du classement¶
The collation specifications of all input arguments must be compatible.
The collation of the result of the function is the highest-precedence collation of the inputs.
Exemples¶
Appeler NVL avec les valeurs NULL et non NULL pour la première expression :
SELECT NVL('food', 'bard') AS col1, NVL(NULL, 3.14) AS col2; +------+------+ | COL1 | COL2 | +------+------+ | food | 3.14 | +------+------+