# Reorder columns

Shape / columns

A variant of [Choose and rename columns](https://meridian.online/operations/choose-and-rename-columns).

Change the order of the columns without changing which columns there are.

Page: <https://meridian.online/operations/choose-and-rename-columns/reorder-columns>

## Status

Runs as a SQL step.

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

## The DuckDB step

reorder columns without changing which there are

It reads the `orders` table the proofs share. Create it 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);
```

Then run the statement:

```sql
CREATE TEMP TABLE result AS
SELECT amount, customer, * EXCLUDE (amount, customer) FROM orders;
SELECT * FROM result LIMIT 3;
SELECT CASE WHEN ((SELECT list(column_name) FROM (DESCRIBE result)) = ['amount', 'customer', 'order_id', 'region', 'order_date', 'product', 'tags', 'meta'] AND (SELECT count(*) FROM result) = 10) THEN 'as expected' ELSE error('amount and customer were not moved to the front of the same eight columns') END AS verdict;
```

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).

- Duckle: [`Reorder Columns`](https://github.com/slothflowlabs/duckle/blob/f85f8960edfb6efbf4cb89d58a7b32e16df0e867/website/docs/components.html) (read 2026-09-25)
- EasyMorph: [`Reorder columns`](https://help.easymorph.com/doku.php?id=transformations:reorder) (read 2026-09-27)
- KNIME Analytics Platform: [`Column Resorter`](https://api.hub.knime.com/nodes/*6k1xlCi486vumV3V?details=full) (read 2026-09-27)
- OpenRefine: [`Move column left`](https://openrefine.org/docs/manual/columnediting#renaming-removing-and-moving) (read 2026-09-27)
- OpenRefine: [`Move column right`](https://openrefine.org/docs/manual/columnediting#renaming-removing-and-moving) (read 2026-09-27)
- OpenRefine: [`Move column to beginning`](https://openrefine.org/docs/manual/columnediting#renaming-removing-and-moving) (read 2026-09-27)
- OpenRefine: [`Move column to end`](https://openrefine.org/docs/manual/columnediting#renaming-removing-and-moving) (read 2026-09-27)
- Power Query M: [`Table.ReorderColumns`](https://learn.microsoft.com/en-us/powerquery-m/table-functions#column-operations) (read 2026-09-27)
- RapidMiner Studio: [`Reorder Attributes`](https://docs.rapidminer.com/latest/studio/operators/blending/attributes/order_attributes.html) (read 2026-09-27)
- RapidMiner Studio: [`Reorder Attributes (In Database)`](https://docs.rapidminer.com/latest/studio/operators/extensions/In-Database%20Processing/indb_blending/indb_reorder_attributes.html) (read 2026-09-27)
- Tableau Prep: [`Reorder fields`](https://help.tableau.com/current/prep/en-us/prep_explore.htm) (read 2026-09-27)
- Trifacta: [`Move Transform`](https://help.alteryx.com/aac/en/trifacta-classic/wrangle-language/language-appendices/transforms.html) (read 2026-09-27)
- Trifacta: [`Move columns`](https://help.alteryx.com/aac/en/trifacta-classic/reference/transformation-reference.html) (read 2026-09-27)
- VisiData: [`slide-left`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/slide.py#L67) (read 2026-09-23)
- VisiData: [`slide-left-n`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/slide.py#L75) (read 2026-09-23)
- VisiData: [`slide-leftmost`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/slide.py#L71) (read 2026-09-23)
- VisiData: [`slide-right`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/slide.py#L68) (read 2026-09-23)
- VisiData: [`slide-right-n`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/slide.py#L76) (read 2026-09-23)
- VisiData: [`slide-rightmost`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/features/slide.py#L72) (read 2026-09-23)
