v.24.5New Feature

Support for clamp function in ClickHouse

Support for conditional function clamp. #62377 (skyoct).
Added support for the conditional function clamp in ClickHouse.

Why it matters

The clamp function allows users to constrain a value within specified lower and upper bounds, ensuring that the result does not go below or above these limits. This feature simplifies data validation and conditional value enforcement within queries.

How to use it

Use the clamp function in your SQL queries by specifying the value and the lower and upper bounds as arguments, for example:

SELECT clamp(value, lower_bound, upper_bound) FROM table;