프로그래밍/DB2009.04.10 13:50
출처: http://www.techonthenet.com/oracle/functions/decode.php

용도:

In Oracle/PLSQL, the decode function has the functionality of an IF-THEN-ELSE statement.

The syntax for the decode function is:

decode( expression , search , result [, search , result]... [, default] )


사용법:

SELECT supplier_name,
decode(supplier_id, 10000, 'IBM',
10001, 'Microsoft',
10002, 'Hewlett Packard',
'Gateway') result
FROM suppliers;
Posted by 시난
TAG