본문 바로가기

삽질기행/코드놀음

[SQL] CASE~ 문

select

NAME, COMPANY,

SAL =

CASE WHEN SAL = '01' THEN '사원'    -- 콤마( , ) 안들어가는거다!!

CASE WHEN SAL = '01' THEN '대리'

CASE WHEN SAL = '01' THEN '과장'

CASE WHEN SAL = '01' THEN '부장'

END

from RECRUIT

where a > 0