R46 – CASE has no default ELSE statement (WMB)

CASE has no default ELSE statement (WMB)

A case statement with no default path could indicate a logic error. It can also be confusing.

For example SET description =
   CASE age
     WHEN ’0′ THEN ‘really young’
     WHEN ’100′ THEN ‘really old’
   END;
Preferred

SET description =
   CASE age
     WHEN ’0′ THEN ‘really young’
     WHEN ’100′ THEN ‘really old’
     ELSE ‘Somewhere inb etween’
  END;