Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 226 Bytes

copy-a-table-with-schema,-indexes-and-data.md

File metadata and controls

9 lines (5 loc) · 226 Bytes

How to copy a table with schema, indexes and data

First, copy the table with indexes

CREATE TABLE new_name LIKE table_to_copy;

Then copy the data by running

INSERT INTO new_name SELECT * FROM table_to_copy;