# Repeat each row

Shape / rows

A variant of [Split a list into rows](https://meridian.online/operations/split-a-list-into-rows).

Emit several copies of each row, a set or column-given number of times or along a generated sequence.

Page: <https://meridian.online/operations/split-a-list-into-rows/repeat-each-row>

## Status

Runs as a SQL step.

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

## The DuckDB step

repeat each row a set number of times, a column-given number of times or along a sequence

```sql
CREATE TEMP TABLE items AS SELECT * FROM (VALUES ('a', 2), ('b', 0), ('c', 3)) t(sku, copies);
-- a set number of copies
CREATE TEMP TABLE fixed AS SELECT sku FROM items, range(2) r(copy);
-- the number of copies is in a column; a row with 0 copies disappears
CREATE TEMP TABLE by_column AS SELECT sku, r.copy + 1 AS copy FROM items, range(items.copies) r(copy);
-- one copy for each day of a generated sequence
CREATE TEMP TABLE along_sequence AS
SELECT sku, d::DATE AS day FROM items, generate_series(DATE '2026-03-01', DATE '2026-03-03', INTERVAL 1 DAY) g(d);
SELECT * FROM by_column ORDER BY sku, copy;
SELECT CASE WHEN ((SELECT count(*) FROM fixed) = 6 AND (SELECT list((sku, copy) ORDER BY sku, copy) FROM by_column) = [('a', 1), ('a', 2), ('c', 1), ('c', 2), ('c', 3)] AND (SELECT count(*) FROM along_sequence) = 9 AND (SELECT list(day ORDER BY day) FROM along_sequence WHERE sku = 'b') = [DATE '2026-03-01', DATE '2026-03-02', DATE '2026-03-03']) THEN 'as expected' ELSE error('the rows were not repeated twice each, by their own count (2, 0 and 3) or along three days') 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).

- Alteryx Designer: [`Generate Rows`](https://help.alteryx.com/current/en/designer/tools/preparation/generate-rows-tool.html) (read 2026-09-27)
- EasyMorph: [`Repeat rows`](https://help.easymorph.com/doku.php?id=transformations:repeatrows) (read 2026-09-27)
- Apache Hop: [`Clone row`](https://hop.apache.org/manual/latest/pipeline/transforms/clonerow.html) (read 2026-09-27)
- Pentaho Data Integration: [`Clone row`](https://docs.pentaho.com/pdia-data-integration/9.3-data-integration/pdi-transformation-steps-reference-overview) (read 2026-09-27)
- Power Query M: [`Table.Repeat`](https://learn.microsoft.com/en-us/powerquery-m/table-functions#row-operations) (read 2026-09-27)
- Talend: [`tDuplicateRow`](https://help.qlik.com/talend/en-US/components/8.0/data-privacy/data-privacy-component) (read 2026-09-27)
