sumCount
Introduced in: v21.6.0 Calculates the sum of the numbers and counts the number of rows at the same time. The function is used by ClickHouse query optimizer: if there are multiplesum, count or avg functions in a query, they can be replaced to single sumCount function to reuse the calculations. The function is rarely needed to use explicitly.
See also
optimize_syntax_fuse_functionssetting.
(sum, count), where sum is the sum of numbers and count is the number of rows with not-NULL values. Tuple
Examples
Basic usage
Query
Response
- optimize_syntax_fuse_functions setting.