-
numbers() – Returns an infinite table with a single number column (UInt64) that contains integers in ascending order, starting from 0. Use LIMIT (and optionally OFFSET) to restrict the number of rows.
-
numbers(N) – Returns a table with a single number column (UInt64) that contains integers from 0 to N - 1.
-
numbers(N, M) – Returns a table with a single number column (UInt64) that contains M integers from N to N + M - 1.
-
numbers(N, M, S) – Returns a table with a single number column (UInt64) that contains values in [N, N + M) with step S (about M / S rows, rounded up). S must be >= 1.
This is similar to the system.numbers system table. It can be used for testing and generating successive values.
The following queries are equivalent:
The following queries are also equivalent:
The following queries are also equivalent:
Examples
The first 10 numbers.
Generate a sequence of dates from 2010-01-01 to 2010-12-31.
Find the first UInt64 >= 10^15 whose sipHash64(number) has 20 trailing zero bits.
Notes
- For performance reasons, if you know how many rows you need, prefer bounded forms (
numbers(N), numbers(N, M[, S])) over unbounded numbers() / system.numbers.
- For parallel generation, use
numbers_mt(...) or the system.numbers_mt table. Note that results may be returned in any order.
Last modified on July 2, 2026