Archive

Archive for November, 2011

How to copy a table structure and data

November 9, 2011 5 comments

To copy table structure run this query

CREATE TABLE database_name.`new_table_name` LIKE database_name.`old_table_name` ;

To copy table data run this query

INSERT INTO database_name.`new_table_name` SELECT * FROM database_name.`old_table_name` ;

%d bloggers like this: