SEQUENCE
All functions > ARRAY > SEQUENCE
Generates an array containing a sequence of numbers from start to stop with optional step.
Signatures
Returns: Array of numbers in the sequence
SEQUENCE(start: BIGINT, stop: BIGINT, [step: BIGINT]) → ARRAY<BIGINT> sql
| Parameter | Type | Required | Description |
|---|---|---|---|
start | BIGINT | Yes | Starting value (inclusive) |
stop | BIGINT | Yes | Ending value (inclusive) |
step | BIGINT | No | Optional step value (default: 1) |
Notes
- Generates sequence from start to stop inclusive
- Default step is 1
- Can use negative step for descending sequences
- Both start and stop are included in result
On this page