- カテゴリ:
NVL¶
expr1
が NULL の場合は、 expr2
を返します。それ以外の場合は expr1
を返します。
- エイリアス
構文¶
NVL( <expr1> , <expr2> )
引数¶
expr1
NULL かどうかを確認するためにチェックされる式です。
expr2
expr1
が NULLの場合にこの式が評価され、値が返されます。
照合の詳細¶
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.
例¶
最初の式に対して NULL と非NULLの値の両方で NVL を呼び出します。
SELECT NVL('food', 'bard') AS col1, NVL(NULL, 3.14) AS col2; +------+------+ | COL1 | COL2 | +------+------+ | food | 3.14 | +------+------+