DOCSUP-7100: Add avg translation, argmax query fixes.

This commit is contained in:
romanzhukov 2021-03-03 01:59:12 +03:00
parent dbd91442e0
commit 3d3639b99a
2 changed files with 17 additions and 15 deletions

View File

@ -14,19 +14,12 @@ avg(x)
**Arguments**
- `x` — Values.
`x` must be
[Integer](../../../sql-reference/data-types/int-uint.md),
[floating-point](../../../sql-reference/data-types/float.md), or
[Decimal](../../../sql-reference/data-types/decimal.md).
- `x` — input values, must be [Integer](../../../sql-reference/data-types/int-uint.md), [floating-point](../../../sql-reference/data-types/float.md), or [Decimal](../../../sql-reference/data-types/decimal.md).
**Returned value**
- `NaN` if the supplied parameter is empty.
- Mean otherwise.
**Return type** is always [Float64](../../../sql-reference/data-types/float.md).
- The arithmetic mean, always as [Float64](../../../sql-reference/data-types/float.md).
- `NaN` if the input parameter `x` is empty.
**Example**
@ -46,11 +39,20 @@ Result:
**Example**
Create a temp table:
Query:
``` sql
CREATE table test (t UInt8) ENGINE = Memory;
SELECT avg(t) FROM test
```
Get the arithmetic mean:
Query:
```
SELECT avg(t) FROM test;
```
Result:
@ -60,3 +62,5 @@ Result:
│ nan │
└────────┘
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/avg/) <!--hide-->

View File

@ -47,9 +47,7 @@ SELECT avg(x) FROM values('x Int8', 0, 1, 2, 3, 4, 5);
CREATE table test (t UInt8) ENGINE = Memory;
```
Получите среднее арифметическое:
Запрос:
Выполните запрос:
``` sql
SELECT avg(t) FROM test;
@ -63,4 +61,4 @@ SELECT avg(t) FROM test;
└────────┘
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/avg/) <!--hide-->
[Оригинальная статья](https://clickhouse.tech/docs/ru/sql-reference/aggregate-functions/reference/avg/) <!--hide-->