Mega Code Archive

 
Categories / MySQL / Function
 

CASE is a variant of IF that is useful when all the branch decisions depend on the value of a single expression

CASE expression WHEN value1 THEN commands; [WHEN value2 THEN commands;] [ELSE commands;] END CASE;