달력

62025  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

[함수]NVL, NVL2

DB 2008. 11. 6. 18:05

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

NVL

Syntax

nvl::=

Text description of functions180.gif follows 

NVL2

Syntax

nvl2::=

Text description of functions28.gif follows 

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
Posted by marryjane
|