# Append tables

Join / union

append tables by rows

Page: <https://meridian.online/operations/append-tables>

## Status

Runs as a SQL step.

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

## The DuckDB step

append tables whose columns differ

It reads the `orders` and `customers` tables the proofs share. Create them first:

```sql
CREATE TABLE orders AS SELECT * FROM (VALUES
  (1,  'Alice Ng',      'north', DATE '2026-01-03', 120.00, 'widget', 'a|b',   '{"channel":"web","items":[1,2]}'),
  (2,  'alice ng',      'north', DATE '2026-01-05',  80.50, 'gadget', 'b',     '{"channel":"shop","items":[3]}'),
  (3,  'Bob  Okafor',   'south', DATE '2026-01-05', 300.00, 'widget', 'a|c',   '{"channel":"web","items":[4,5,6]}'),
  (4,  'Carla Díaz',    'east',  DATE '2026-01-09',  NULL,  'gizmo',  NULL,    '{"channel":"web","items":[]}'),
  (5,  'Bob Okafor',    'south', DATE '2026-01-12',  45.25, 'gadget', 'c',     '{"channel":"phone","items":[7]}'),
  (6,  'Dev Patel',     'west',  DATE '2026-01-12', 510.00, 'widget', 'a',     '{"channel":"web","items":[8,9]}'),
  (7,  'Carla Diaz',    'east',  DATE '2026-01-20',  99.99, 'gizmo',  'b|c',   '{"channel":"shop","items":[10]}'),
  (8,  'Dev Patel',     'west',  DATE '2026-02-02', 510.00, 'widget', 'a',     '{"channel":"web","items":[8,9]}'),
  (9,  'Eve Larsen',    NULL,    DATE '2026-02-03',  15.00, 'gadget', NULL,    '{"channel":"web","items":[11]}'),
  (10, 'Alice Ng',      'north', DATE '2026-02-10', 220.00, 'gizmo',  'a|b|c', '{"channel":"phone","items":[12,13]}')
) t(order_id, customer, region, order_date, amount, product, tags, meta);

CREATE TABLE customers AS SELECT * FROM (VALUES
  ('Alice Ng',    'retail',    DATE '2025-06-01', 52.52, 13.40),
  ('Bob Okafor',  'wholesale', DATE '2025-09-15', 48.85,  2.35),
  ('Carla Diaz',  'retail',    DATE '2025-11-30', 40.42, -3.70),
  ('Frank Moore', 'retail',    DATE '2026-01-01', 51.51, -0.13)
) t(customer, segment, joined, lat, lon);
```

Then run the statement:

```sql
CREATE TEMP TABLE result AS
SELECT customer, region FROM orders UNION ALL BY NAME SELECT customer, segment FROM customers;
SELECT * FROM result;
SELECT CASE WHEN ((SELECT count(*) = 14 AND count(region) = 9 AND count(segment) = 4 FROM result)) THEN 'as expected' ELSE error('the two tables did not append to 14 rows with each column filled from its own table') END AS verdict;
```

It needs nothing installed beyond DuckDB itself.

## Variants

- Stack tables by rows: Stack the rows of two or more tables into one, matching columns by name or by position and keeping every row.
- [Append tables and drop duplicate rows](https://meridian.online/operations/append-tables/append-and-drop-duplicates): Stack the rows of two or more tables and keep only one copy of each distinct row.
- Append many files or shards: Combine the rows of many files, messages or sharded tables picked by a pattern or a grouping rule into one table.
- [Merge sorted tables](https://meridian.online/operations/append-tables/merge-sorted-tables): Interleave tables already sorted on a key into one table that stays sorted on that key.
- [Append tables with a source column](https://meridian.online/operations/append-tables/append-with-a-source-column): Stack the rows of several tables and add a column that records which table each row came from.

## What other tools call it

Meridian's classification; an independent blind rating agreed on 86.2% of 312 rows (exact class, version 2).

- Azure Data Factory: [`Union`](https://learn.microsoft.com/en-us/azure/data-factory/data-flow-union) (read 2026-09-27)
- Alteryx Designer: [`Union`](https://help.alteryx.com/current/en/designer/tools/join/union-tool.html) (read 2026-09-27)
- Alteryx Designer: [`Union In-DB`](https://help.alteryx.com/current/en/designer/tools/in-database/union-in-db-tool.html) (read 2026-09-27)
- Apache DataFusion: [`UNION`](https://datafusion.apache.org/user-guide/sql/select.html) (read 2026-09-27)
- Apache DataFusion: [`UNION`](https://datafusion.apache.org/user-guide/sql/select.html) (read 2026-09-27)
- Apache DataFusion: [`UNION BY NAME`](https://datafusion.apache.org/user-guide/sql/select.html) (read 2026-09-27)
- Apache DataFusion: [`union`](https://docs.rs/datafusion/latest/datafusion/dataframe/struct.DataFrame.html) (read 2026-09-27)
- Apache DataFusion: [`union_by_name`](https://docs.rs/datafusion/latest/datafusion/dataframe/struct.DataFrame.html) (read 2026-09-27)
- Apache DataFusion: [`union_by_name_distinct`](https://docs.rs/datafusion/latest/datafusion/dataframe/struct.DataFrame.html) (read 2026-09-27)
- Apache DataFusion: [`union_distinct`](https://docs.rs/datafusion/latest/datafusion/dataframe/struct.DataFrame.html) (read 2026-09-27)
- dbt-utils: [`union_relations`](https://raw.githubusercontent.com/dbt-labs/dbt-utils/main/README.md) (read 2026-09-27)
- Duckle: [`Merge Streams`](https://github.com/slothflowlabs/duckle/blob/f85f8960edfb6efbf4cb89d58a7b32e16df0e867/frontend/src/workflow-ui/palette-data.ts) (read 2026-09-25)
- Duckle: [`Union`](https://github.com/slothflowlabs/duckle/blob/f85f8960edfb6efbf4cb89d58a7b32e16df0e867/website/docs/components.html) (read 2026-09-25)
- Duckle: [`Union All`](https://github.com/slothflowlabs/duckle/blob/f85f8960edfb6efbf4cb89d58a7b32e16df0e867/website/docs/components.html) (read 2026-09-25)
- EasyMorph: [`Append another table`](https://help.easymorph.com/doku.php?id=transformations:append) (read 2026-09-27)
- AWS Glue: [`Union`](https://docs.aws.amazon.com/glue/latest/dg/transforms-configure-union.html) (read 2026-09-27)
- AWS Glue: [`union`](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-crawler-pyspark-extensions-dynamic-frame.html) (read 2026-09-27)
- Apache Hop: [`Append Streams`](https://hop.apache.org/manual/latest/pipeline/transforms/append.html) (read 2026-09-27)
- Apache Hop: [`Sorted Merge`](https://hop.apache.org/manual/latest/pipeline/transforms/sortedmerge.html) (read 2026-09-27)
- Apache Hop: [`Sorted schema merge`](https://hop.apache.org/manual/latest/pipeline/transforms/sortedschemamerge.html) (read 2026-09-27)
- Apache Hop: [`Stream schema merge`](https://hop.apache.org/manual/latest/pipeline/transforms/streamschemamerge.html) (read 2026-09-27)
- Ibis: [`Union`](https://github.com/ibis-project/ibis/blob/05d2b293344e86cb41c1a426071734f7e270335a/ibis/expr/operations/relations.py) (read 2026-09-27)
- KNIME Analytics Platform: [`Concatenate`](https://api.hub.knime.com/nodes/*0rhLXWO6OS1xMi8T?details=full) (read 2026-09-27)
- KNIME Analytics Platform: [`DB Concatenate`](https://api.hub.knime.com/nodes/*MBPKzHa0NhiQYeqd?details=full) (read 2026-09-27)
- Apache NiFi: [`MergeContent`](https://nifi.apache.org/components/org.apache.nifi.processors.standard.MergeContent/) (read 2026-09-27)
- Apache NiFi: [`MergeRecord`](https://nifi.apache.org/components/org.apache.nifi.processors.standard.MergeRecord/) (read 2026-09-27)
- Pentaho Data Integration: [`Append streams`](https://docs.pentaho.com/pdia-data-integration/9.3-data-integration/pdi-transformation-steps-reference-overview) (read 2026-09-27)
- Pentaho Data Integration: [`Prioritize streams`](https://docs.pentaho.com/pdia-data-integration/9.3-data-integration/pdi-transformation-steps-reference-overview) (read 2026-09-27)
- Pentaho Data Integration: [`Sorted Merge`](https://docs.pentaho.com/pdia-data-integration/9.3-data-integration/pdi-transformation-steps-reference-overview) (read 2026-09-27)
- Polars: [`DataFrame.extend`](https://docs.pola.rs/api/python/stable/reference/dataframe/modify_select.html) (read 2026-09-27)
- Polars: [`DataFrame.merge_sorted`](https://docs.pola.rs/api/python/stable/reference/dataframe/modify_select.html) (read 2026-09-27)
- Polars: [`DataFrame.vstack`](https://docs.pola.rs/api/python/stable/reference/dataframe/modify_select.html) (read 2026-09-27)
- Polars: [`concat`](https://docs.pola.rs/api/python/stable/reference/functions.html) (read 2026-09-27)
- Polars: [`merge_sorted`](https://docs.pola.rs/api/python/stable/reference/functions.html) (read 2026-09-27)
- Polars: [`union`](https://docs.pola.rs/api/python/stable/reference/functions.html) (read 2026-09-27)
- Power Query M: [`Table.Combine`](https://learn.microsoft.com/en-us/powerquery-m/table-functions#row-operations) (read 2026-09-27)
- Power Query M: [`Table.FromPartitions`](https://learn.microsoft.com/en-us/powerquery-m/table-functions#row-operations) (read 2026-09-27)
- RapidMiner Studio: [`Append`](https://docs.rapidminer.com/latest/studio/operators/blending/table/joins/append.html) (read 2026-09-27)
- RapidMiner Studio: [`Append (Robust)`](https://docs.rapidminer.com/latest/studio/operators/blending/table/joins/append_robust.html) (read 2026-09-27)
- RapidMiner Studio: [`Append (Superset)`](https://docs.rapidminer.com/latest/studio/operators/extensions/Operator%20Toolbox/blending/table/advanced_append.html) (read 2026-09-27)
- RapidMiner Studio: [`Union`](https://docs.rapidminer.com/latest/studio/operators/blending/table/joins/union.html) (read 2026-09-27)
- RapidMiner Studio: [`Union (In Database)`](https://docs.rapidminer.com/latest/studio/operators/extensions/In-Database%20Processing/indb_blending/indb_union.html) (read 2026-09-27)
- Apache SeaTunnel: [`TableMerge`](https://seatunnel.apache.org/docs/2.3.13/transforms/table-merge) (read 2026-09-27)
- SQLMesh: [`@UNION`](https://github.com/SQLMesh/sqlmesh/blob/23b237cea7218cc8f338b89c14f0957394a0003b/docs/concepts/macros/sqlmesh_macros.md) (read 2026-09-27)
- Tableau Prep: [`Union`](https://help.tableau.com/current/prep/en-us/prep_combine.htm) (read 2026-09-27)
- Tableau Prep: [`Union files and database tables in the Input step`](https://help.tableau.com/current/prep/en-us/prep_add_input_data.htm) (read 2026-09-27)
- Talend: [`tUnite`](https://help.qlik.com/talend/en-US/components/8.0/orchestration/orchestration-component) (read 2026-09-27)
- Trifacta: [`Union datasets`](https://help.alteryx.com/aac/en/trifacta-classic/reference/transformation-reference.html) (read 2026-09-27)
- VisiData: [`join-cols-append`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/join.py#L423) (read 2026-09-23)
- VisiData: [`join-cols-concat`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/join.py#L423) (read 2026-09-23)
- VisiData: [`join-selected-append`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/join.py#L420) (read 2026-09-23)
- VisiData: [`join-selected-concat`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/join.py#L420) (read 2026-09-23)
- VisiData: [`join-sheets-all-append`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/join.py#L422) (read 2026-09-23)
- VisiData: [`join-sheets-all-concat`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/join.py#L422) (read 2026-09-23)
- VisiData: [`join-sheets-top2-append`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/join.py#L421) (read 2026-09-23)
- VisiData: [`join-sheets-top2-concat`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/join.py#L421) (read 2026-09-23)
- VisiData: [`s3-join-rows`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/loaders/s3.py#L315) (read 2026-09-23)
