How to Duplicate a Table in ClickHouse
Last updated July 25, 2026 · By the SaturnSQL team
CREATE TABLE new AS old copies the structure and engine but no data; follow it with INSERT INTO new SELECT * FROM old to copy the rows. For partitioned tables, ATTACH PARTITION FROM copies whole partitions without rewriting data.
CREATE TABLE events_backup AS events;
INSERT INTO events_backup SELECT * FROM events;Copy a partition without rewriting
ALTER TABLE events_backup ATTACH PARTITION 202607 FROM events;Run this in SaturnSQL
SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.
Try it free