ad2bar


case sql select


  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








트랙백

이 글과 관련된 글 쓰기 (트랙백 보내기)
TrackbackURL : http://theurgistk.egloos.com/tb/5504768 [도움말]

덧글

댓글 입력 영역



[유디엠] 프리미엄스폰서위젯B

[유디엠] 추천 도서 위젯