[SQL] programmers 대장균의 크기에 따라 분류하기 1

도리·2025년 4월 22일

coding test study 📝

목록 보기
87/90

case when then 쓸 때 폼 주의!!

  • case 한번만
  • when then when then... end as ...
  • 쉼표 안씀
select id, 
         case when size_of_colony <= 100 then 'LOW'
              when size_of_colony > 100 and size_of_colony <= 1000 then 'MEDIUM'
               when size_of_colony > 1000 then 'HIGH'
         end as size
from ecoli_data
order by id
profile
SW engineer · voice interaction × robotics × sensing · making robots move, and making data visible for intuitive debugging 🤖📡

0개의 댓글