ClickHouse/docs/en/sql-reference/table-functions/numbers.md
Ivan Blinkov d91c97d15d
[docs] replace underscores with hyphens (#10606)
* Replace underscores with hyphens

* remove temporary code

* fix style check

* fix collapse
2020-04-30 21:19:18 +03:00

29 lines
863 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
toc_priority: 39
toc_title: numbers
---
# numbers {#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, `numbers(N, M)` more efficient than `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 dates from 2010-01-01 to 2010-12-31
select toDate('2010-01-01') + number as d FROM numbers(365);
```
[Original article](https://clickhouse.tech/docs/en/query_language/table_functions/numbers/) <!--hide-->