{ "name": "CASE", "type": "expression", "groups": ["Conditionals"], "description": "The CASE expression evaluates several conditions and returns a result when the first condition is met. When a condition is true, it will stop reading and return the corresponding result. If none of the conditions is true, it returns the value in the ELSE clause. Furthermore, if no ELSE clause is set and none of the conditions is met, it returns NULL.
CASE
WHEN condition THEN result
[ …n ]
[ ELSE result ]
END
[ ] marks optional components
", "arguments": [ {"arg":"WHEN condition","description":"The condition expression to evaluate"}, {"arg":"THEN result","description":"If condition evaluates to True then result is evaluated and returned."}, {"arg":"ELSE result","description":"If none of the above conditions evaluated to True then result is evaluated and returned."} ], "examples": [ { "expression":"CASE WHEN \"column\" IS NULL THEN 'None' END", "returns":" Returns the string 'none' if the \"column\" field is NULL"} ] }