case 조건문1 MySQL / MariaDB case. when. then. 단일/다중 조건문. MySQL / MariaDB case. when. then. 다중조건문 사용하기. select case when 조건1 then 반환값 when 조건2 then 반환값 else 반환값 endfrom table_id; ex ) select case when a= 1 then 'A' when a= 2 then 'B' else 'C' end from table_id; ex ) select case when a= 1 and b = 2 then 'A' when a+b > 2 or b = 3 then 'B' else 'C' end from table_id; 2022. 1. 19. 이전 1 다음