v.25.3New Feature

Support switching on explicit values

Non-constant CASE support for switching on explicit values. #77399 (Yarik Briukhovetskyi).
Support for CASE expressions with non-constant values, enabling switching on explicit runtime values.

Why it matters

This feature allows users to write CASE expressions that switch based on non-constant values rather than only constants. It enhances query flexibility by enabling dynamic conditional logic dependent on runtime data, improving expressiveness and control in SQL queries.

How to use it

Write CASE expressions in your SQL queries using non-constant expressions within the CASE statement. For example:

SELECT
CASE some_column
WHEN dynamic_value THEN 'Result A'
ELSE 'Result B'
END
FROM table_name


No special settings are required as the feature is available by default.