Copying an existing table to a new table in MySQL

pradeep's Avatar author of Copying an existing table to a new table in MySQL
This is an article on Copying an existing table to a new table in MySQL in MySQL.
Sometimes we require to copy an existing MySQL table to another table, usually we get the SQL dump and execute it to create the new table, but we have a shortcut to do that.

For instance if we need to make a copy of go4expert_users to a table named go4expert_users_new we need to execute the following command.

Code: SQL
INSERT go4expert_users_new SELECT * FROM go4expert_users;

The query copies the data from old to new.Try it!
0
kingswhale's Avatar, Join Date: Sep 2011
Newbie Member
i love this post, but am still a leaner. so one day i will come out shining
0
mukeshsoftona's Avatar
Banned
Hey dear!

I love this topic and want to know more about MQL.
There is something different between mysql and sql