ヘッダーをスキップ
Oracle TimesTen In-Memory Database SQLリファレンス・ガイド
リリース11.2.1
B56051-01
  目次
目次
索引
索引

戻る
戻る
 
次へ
次へ
 

NVL

NVL関数は、NULL値を2番目の値に置き換えます。

SQL構文

NVL(Expression1, Expression2)

パラメータ

NVLには、次のパラメータがあります。

パラメータ 説明
Expression1 値がNULLであるかをテストする式。
Expression2 Expression1の値がNULLの場合に使用される、かわりの値。

説明

この例では、姓がBで始まる従業員に対して、commission_pctのNULL値を確認し、それらの値を'Not Applicable'に置き換えます。

Command> SELECT last_name, NVL(TO_CHAR(commission_pct), 'Not Applicable')
       > FROM employees
       > WHERE last_name LIKE 'B%'
       > ORDER BY last_name;
< Baer, Not Applicable >
< Baida, Not Applicable >
< Banda, .1 >
< Bates, .15 >
< Bell, Not Applicable >
< Bernstein, .25 >
< Bissot, Not Applicable >
< Bloom, .2 >
< Bull, Not Applicable >
9 rows found.