mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
Merge branch 'annadevyatova-DOCSUP-8711-sumCount' of https://github.com/adevyatova/ClickHouse into annadevyatova-DOCSUP-8711-sumCount
This commit is contained in:
commit
f19fdb9487
@ -3015,7 +3015,7 @@ Query:
|
||||
``` sql
|
||||
CREATE TABLE fuse_tbl(a Int8, b Int8) Engine = Log;
|
||||
SET optimize_fuse_sum_count_avg = 1;
|
||||
EXPLAIN SYNTAX SELECT sum(a), sum(b), count(b) from fuse_tbl FORMAT TSV;
|
||||
EXPLAIN SYNTAX SELECT sum(a), sum(b), count(b), avg(b) from fuse_tbl FORMAT TSV;
|
||||
```
|
||||
|
||||
Result:
|
||||
@ -3024,7 +3024,8 @@ Result:
|
||||
SELECT
|
||||
sum(a),
|
||||
sumCount(b).1,
|
||||
sumCount(b).2
|
||||
sumCount(b).2,
|
||||
(sumCount(b).1) / (sumCount(b).2)
|
||||
FROM fuse_tbl
|
||||
```
|
||||
|
||||
|
@ -14,7 +14,7 @@ sumCount(x)
|
||||
|
||||
**Returned value**
|
||||
|
||||
- Tuple `(sum, count)`, where `sum` is the sum of numbers and `count` is a counts the number of rows or not-NULL values.
|
||||
- Tuple `(sum, count)`, where `sum` is the sum of numbers and `count` is the number of rows with not-NULL values.
|
||||
|
||||
Type: [Tuple](../../../sql-reference/data-types/tuple.md).
|
||||
|
||||
@ -38,4 +38,4 @@ Result:
|
||||
|
||||
**See also**
|
||||
|
||||
- [optimize_fuse_sum_count_avg](../../../operations/settings/settings.md#optimize_fuse_sum_count_avg) setting.
|
||||
- [optimize_fuse_sum_count_avg](../../../operations/settings/settings.md#optimize_fuse_sum_count_avg) setting.
|
||||
|
@ -2906,7 +2906,7 @@ SELECT * FROM test LIMIT 10 OFFSET 100;
|
||||
``` sql
|
||||
CREATE TABLE fuse_tbl(a Int8, b Int8) Engine = Log;
|
||||
SET optimize_fuse_sum_count_avg = 1;
|
||||
EXPLAIN SYNTAX SELECT sum(a), sum(b), count(b) from fuse_tbl FORMAT TSV;
|
||||
EXPLAIN SYNTAX SELECT sum(a), sum(b), count(b), avg(b) from fuse_tbl FORMAT TSV;
|
||||
```
|
||||
|
||||
Результат:
|
||||
@ -2915,7 +2915,8 @@ EXPLAIN SYNTAX SELECT sum(a), sum(b), count(b) from fuse_tbl FORMAT TSV;
|
||||
SELECT
|
||||
sum(a),
|
||||
sumCount(b).1,
|
||||
sumCount(b).2
|
||||
sumCount(b).2,
|
||||
(sumCount(b).1) / (sumCount(b).2)
|
||||
FROM fuse_tbl
|
||||
```
|
||||
|
||||
|
@ -18,7 +18,7 @@ sumCount(x)
|
||||
|
||||
**Возвращаемое значение**
|
||||
|
||||
- Кортеж из элементов `(sum, count)`, где `sum` — это сумма чисел и `count` — количество строк или не-нулевых значений.
|
||||
- Кортеж из элементов `(sum, count)`, где `sum` — это сумма чисел и `count` — количество строк со значениями, отличными от `NULL`.
|
||||
|
||||
Тип: [Tuple](../../../sql-reference/data-types/tuple.md).
|
||||
|
||||
@ -27,8 +27,9 @@ sumCount(x)
|
||||
Запрос:
|
||||
|
||||
``` sql
|
||||
CREATE TABLE test (x Int8) Engine = Log;
|
||||
CREATE TABLE test (x Nullable(Int8)) Engine = Log;
|
||||
INSERT INTO test SELECT number FROM numbers(1, 20);
|
||||
INSERT INTO test VALUES (NULL);
|
||||
SELECT sumCount(x) from test;
|
||||
```
|
||||
|
||||
@ -42,4 +43,4 @@ SELECT sumCount(x) from test;
|
||||
|
||||
**Смотрите также**
|
||||
|
||||
- Настройка [optimize_fuse_sum_count_avg](../../../operations/settings/settings.md#optimize_fuse_sum_count_avg)
|
||||
- Настройка [optimize_fuse_sum_count_avg](../../../operations/settings/settings.md#optimize_fuse_sum_count_avg)
|
||||
|
Loading…
Reference in New Issue
Block a user