Fik dette svar på forum.mysql.com.
---------------------------------------------
CREATE TABLE with AS SELECT clause allows to specify column attributes explicitly.
CREATE TABLE table2 (PRIMARY KEY(id)) AS SELECT * FROM table1;
But there is a LIKE clause that creates new table with appropriate structure.
CREATE TABLE table2 LIKE table1;
After, populate your data:
INSERT INTO table2 SELECT * FROM table1;
Devart Company,
Database development tools
http://www.devart.com/dbforge.-------------------------------------------------
Løsningen er så:
----------------------------
CREATE TABLE new_table1 LIKE old_table1
INSERT INTO new_table1 SELECT * FROM old_table1
Jeg har testet det og det virker :)
Tak for hurtigt svar herinde!