반응형
-- case절 사용하기 ~
select a.id,a.name,b.level
,case when b.mem_level = '3' then '0'
when b.level = '4' then '1'
when b.level = '5' then '2'
else 'etc'
end slct
from basic a
left join view b
on a.no = b.no limit 10
select a.id,a.name,b.level
,case when b.mem_level = '3' then '0'
when b.level = '4' then '1'
when b.level = '5' then '2'
else 'etc'
end slct
from basic a
left join view b
on a.no = b.no limit 10
반응형