CASE n.eyes
WHEN 'blue' THEN 1
WHEN 'brown' THEN 2
ELSE 3
END
Return THEN value from the matching WHEN value. The ELSE value is optional, and substituted for null if missing.
CASE
WHEN n.eyes = 'blue' THEN 1
WHEN n.age < 40 THEN 2
ELSE 3
END
Return THEN value from the first WHEN predicate evaluating to true. Predicates are evaluated in order.
Comments