# Put tables side by side

Join / positional

put tables side by side, row by row

Page: <https://meridian.online/operations/put-tables-side-by-side>

## Status

Runs as a SQL step.

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

## The DuckDB step

two tables side by side, row by row

It reads the `customers` table the proofs share. Create it first:

```sql
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 * FROM (SELECT customer FROM customers ORDER BY customer) POSITIONAL JOIN (SELECT segment FROM customers ORDER BY customer);
SELECT * FROM result;
SELECT CASE WHEN ((SELECT count(*) = 4 FROM result) AND (SELECT count(*) = 4 FROM result JOIN customers USING (customer, segment))) THEN 'as expected' ELSE error('the rows did not line up by position') END AS verdict;
```

It needs nothing installed beyond DuckDB itself.

## What other tools call it

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

- Polars: [`DataFrame.hstack`](https://docs.pola.rs/api/python/stable/reference/dataframe/modify_select.html) (read 2026-09-27)
- Polars: [`LazyFrame.with_context`](https://docs.pola.rs/api/python/stable/reference/lazyframe/modify_select.html) (read 2026-09-27)
- RapidMiner Studio: [`Merge Attributes`](https://docs.rapidminer.com/latest/studio/operators/extensions/Operator%20Toolbox/blending/table/merge.html) (read 2026-09-27)
