문제
나의 해답
select id, (case when SIZE_OF_COLONY<=100 then 'LOW'
when 100 < SIZE_OF_COLONY and SIZE_OF_COLONY<=1000 then 'MEDIUM'
else 'HIGH' end)as SIZE
from ECOLI_DATA
해설
- case : 조건
- when SIZE_OF_COLONY<=100 then 'LOW' : SIZE_OF_COLONY가 100 이하이면 LOW반환
- when 100 < SIZE_OF_COLONY and SIZE_OF_COLONY<=1000 then 'MEDIUM' : SIZE_OF_COLONY가 101에서 1000이하이면 MEDIUN 반환
- else 'HIGH' end : 그 이외는 HIGH 반환
Share article