[펌글] 오라클 DECODE 함수

By | 1월 23, 2009

* 예문

- select ename, job, decode(job, 'ANALYST', '분석가',
                                          'CLERK', '점원',
                                          'MANAGER', '관리자') as new_job
   from emp;

- select ename, deptno, sal, decode(deptno, 10, sal*1.05,
                                                     20, sal*1.1,
                                                     30, sal*1.15,
                                                     sal) as "인상급여"   -- 짝이 없는 이 sal 은 해당사항 없을 때의 default값
   from emp;

* 상세

http://blog.naver.com/bleu_ciel/140037398850

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments