Help wanted!

The following content of this documentation page has been machine-translated. But unlike other websites, it is not done on the fly. This translated text lives on GitHub repository alongside main ClickHouse codebase and waits for fellow native speakers to make it more human-readable. You can also use the original English version as a reference.

Help ClickHouse documentation by editing this page

数字

numbers(N) – Returns a table with the single ‘number’ 包含从0到N-1的整数的列(UInt64)。
numbers(N, M) -返回一个表与单 ‘number’ 包含从N到(N+M-1)的整数的列(UInt64)。

类似于 system.numbers 表,它可以用于测试和生成连续的值, numbers(N, M)system.numbers.

以下查询是等效的:

  1. SELECT * FROM numbers(10);
  2. SELECT * FROM numbers(0, 10);
  3. SELECT * FROM system.numbers LIMIT 10;

例:

  1. -- Generate a sequence of dates from 2010-01-01 to 2010-12-31
  2. select toDate('2010-01-01') + number as d FROM numbers(365);

原始文章