v.18.14Improvement

Support for intDiv and intDivOrZero Functions for Decimal

Support for the intDiv and intDivOrZero functions for Decimal. b48402e8
Support for the intDiv and intDivOrZero functions applied to Decimal data types in ClickHouse.

Why it matters

This feature enables integer division operations directly on Decimal types, expanding the functionality of intDiv and intDivOrZero. It solves the limitation where these functions previously did not support decimals, allowing users to perform safe and precise integer division with decimal numbers.

How to use it

Users can now use the functions intDiv and intDivOrZero with Decimal columns or expressions just like with integer types. For example:

SELECT intDiv(decimal_column, 10) FROM table;
SELECT intDivOrZero(decimal_column, 0) FROM table;