mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 11:32:03 +00:00
6c16348faa
* fix division by zero * Update src/AggregateFunctions/AggregateFunctionAvg.h Co-authored-by: Dmitry Novik <n0vik@clickhouse.com> * remove trash * Update AggregateFunctionAvg.h Co-authored-by: Dmitry Novik <n0vik@clickhouse.com>
6 lines
433 B
SQL
6 lines
433 B
SQL
SELECT round(avgWeighted(x, y)) FROM (SELECT 1023 AS x, 1000000000 AS y UNION ALL SELECT 10 AS x, -9223372036854775808 AS y);
|
|
select avgWeighted(number, toDecimal128(number, 9)) from numbers(0);
|
|
SELECT avgWeighted(a, toDecimal64(c, 9)) OVER (PARTITION BY c) FROM (SELECT number AS a, number AS c FROM numbers(10));
|
|
select avg(toDecimal128(number, 9)) from numbers(0);
|
|
select avgWeighted(number, toDecimal128(0, 9)) from numbers(10);
|