1 select JOB_ID,
2 case
3 when job_id='SA_MAN' THeN 'Salse Dept'
4 when job_id='SA_REP' THeN 'Salse Dept'
5 when job_id='SH_CLERK' THeN 'Another'
6 when job_id='ST_CLERK' THeN 'Another'
7 when job_id='ST_MAN' THeN 'Another'
8 else JOB_ID
9 end as case
10 from jobs
11* where Job_id like 'S%'
SQL> /
JOB_ID CASE
---------- ----------
SA_MAN Salse Dept
SA_REP Salse Dept
SH_CLERK Another
ST_CLERK Another
ST_MAN Another
1 select JOB_ID,
2 case
3 when job_id like 'SA_%' THEN 'Salse Dept'
4 else 'Another'
5 end as "CACE"
6 from jobs
7* where Job_id like 'S%'
SQL> /
JOB_ID CACE
---------- ----------
SA_MAN Salse Dept
SA_REP Salse Dept
SH_CLERK Another
ST_CLERK Another
ST_MAN Another
태그 : case



덧글