How to duplicate a table with keys & other structure features retained in MySQL?

后端 未结 3 474
无人共我
无人共我 2021-02-03 10:42

How to duplicate a table with keys & other structure features retained? including primary key, foreign keys, and indexes.

Can this be done with a single MySQL query?

3条回答
  •  萌比男神i
    2021-02-03 11:12

    Following query creates and duplicates data.

    CREATE TABLE table2 SELECT * FROM table1

提交回复
热议问题