http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/index.htm
NVL
Syntax
nvl::=

NVL2
Syntax
nvl2::=

Examples
The following example shows whether the income of some employees is made up of salary plus commission, or just salary, depending on whether thecommission_pct
column of employees
is null or not.
SELECT last_name, salary, NVL2(commission_pct, salary + (salary * commission_pct), salary) income FROM employees WHERE last_name like 'B%' ORDER BY last_name; LAST_NAME SALARY INCOME ------------------------- ---------- ---------- Baer 10000 10000 Baida 2900 2900 Banda 6200 6882 Bates 7300 8468 Bell 4000 4000 Bernstein 9500 11970 Bissot 3300 3300 Bloom 10000 12100 Bull 4100 4100
'DB' 카테고리의 다른 글
Toad 를 이용한 excel 로 import (0) | 2008.11.28 |
---|---|
SQLPlus 를 이용한 Query trace (0) | 2008.11.12 |
[함수]DECODE (0) | 2008.11.06 |
ORA-04030 (1) | 2008.11.06 |
대용량DB에서 FK의 필요성 - sarang.net (0) | 2008.10.28 |