Duplicate a table
suggest changeTo duplicate a table in MySQL:
CREATE TABLE newtable LIKE oldtable;
INSERT INTO newtable SELECT * FROM oldtable;
CREATE TABLE ... LIKE copies the column definitions, not the rows. INSERT INTO copies the rows. LIKE in CREATE TABLE is not standard SQL.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents