# Generate a series of numbers

Acquire / generate

A variant of [Generate rows](https://meridian.online/operations/generate-rows).

Emit one row per integer from a start to an end by a step.

Page: <https://meridian.online/operations/generate-rows/generate-a-series-of-numbers>

## Status

Runs as a SQL step.

arcform carries it as a `sql:` step today.

## The DuckDB step

emit the integers from a start to an end by a step

```sql
CREATE TEMP TABLE result AS
SELECT (SELECT list(i ORDER BY i) FROM generate_series(1, 10, 3) t(i)) AS up,
       (SELECT list(i ORDER BY i DESC) FROM generate_series(10, 1, -3) t(i)) AS down,
       (SELECT count(*) FROM generate_series(5, 1)) AS backwards,
       (SELECT list(i ORDER BY i) FROM range(1, 10, 3) t(i)) AS end_excluded;
SELECT * FROM result;
SELECT CASE WHEN ((SELECT up = [1, 4, 7, 10] AND down = [10, 7, 4, 1] AND backwards = 0 AND end_excluded = [1, 4, 7] FROM result)) THEN 'as expected' ELSE error('the series did not run 1, 4, 7, 10 up and 10, 7, 4, 1 down, or an end before the start did not give no rows') END AS verdict;
```

The statement builds its own data.

It needs nothing installed beyond DuckDB itself.

## What other tools call it

Meridian's classification; an independent blind rating agreed on 95.7% of 324 rows (variant, version 3).

- Bruin: [`bruin.generate_series(upper_bound)`](https://getbruin.com/docs/bruin/assets/templating/macros.html) (read 2026-09-27)
- Apache DataFusion: [`table functions (range, generate_series)`](https://datafusion.apache.org/user-guide/sql/select.html) (read 2026-09-27)
- dbt-utils: [`generate_series`](https://raw.githubusercontent.com/dbt-labs/dbt-utils/main/README.md) (read 2026-09-27)
- DuckDB: `generate_series` (read 2026-09-27)
- DuckDB: `range` (read 2026-09-27)
- EasyMorph: [`Sequence`](https://help.easymorph.com/doku.php?id=transformations:sequence) (read 2026-09-27)
- Ibis: [`IntegerRange`](https://github.com/ibis-project/ibis/blob/05d2b293344e86cb41c1a426071734f7e270335a/ibis/expr/operations/arrays.py) (read 2026-09-27)
- Polars: [`Functions: range and sequence generators (group)`](https://docs.pola.rs/api/python/stable/reference/expressions/functions.html) (read 2026-09-27)
