4 Apr 2011

Duplicating a MySQL Table

To duplicate an existing table you can use the following command:
CREATE TABLE `NEW_TABLE` LIKE `OLD_TABLE`
To duplicate an existing table and it's contents you can use:
CREATE TABLE `NEW_TABLE` SELECT * FROM `OLD_TABLE`