v.24.5New Feature
Support for clamp function in ClickHouse
Why it matters
Theclamp 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 theclamp 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;