- Kategorien:
NVL¶
Wenn expr1
den Wert NULL hat, wird expr2
zurückgegeben, ansonsten wird expr1
zurückgegeben.
- Aliasse
Syntax¶
NVL( <expr1> , <expr2> )
Argumente¶
expr1
Der Ausdruck, der darauf geprüft werden soll, ob er NULL ist.
expr2
Wenn
expr1
gleich NULL ist, wird dieser Ausdruck ausgewertet und sein Wert zurückgegeben.
Sortierungsdetails¶
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.
Beispiele¶
Rufen Sie NVL mit NULL- und Nicht-NULL-Werten für den ersten Ausdruck auf:
SELECT NVL('food', 'bard') AS col1, NVL(NULL, 3.14) AS col2; +------+------+ | COL1 | COL2 | +------+------+ | food | 3.14 | +------+------+