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

도리·2025년 4월 22일

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
인공지능응용학과 졸업예정..

0개의 댓글