ClickHouse/docs/en/query_language/table_functions/numbers.md
BayoNet 324fd98de6 Update of english documentation (#2918)
* Updating of english translation.

* Some bugs are fixed.
2018-09-04 14:18:59 +03:00

23 lines
739 B
Markdown

# numbers
`numbers(N)` — Returns a table with the single `number` column (UInt64) that contains integers from `0` to `N-1`.
`numbers(N, M)` — Returns a table with the single `number` column (UInt64) that contains integers from `N` to `(N + M - 1)`.
Similar to the `system.numbers` table, it can be used for testing and generating successive values. The `numbers(N, M)` function is more efficient than a selection from `system.numbers`.
The following queries are equivalent:
```sql
SELECT * FROM numbers(10);
SELECT * FROM numbers(0,10);
SELECT * FROM system.numbers LIMIT 10;
```
Examples:
```sql
-- generate a sequence of all dates from 2010-01-01 to 2010-12-31
select toDate('2010-01-01') + number as d FROM numbers(365);
```