Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MySQL (http://www.go4expert.com/articles/mysql/)
-   -   Copying an existing table to a new table in MySQL (http://www.go4expert.com/articles/copying-existing-table-table-mysql-t2331/)

pradeep 23Dec2006 21:53

Copying an existing table to a new table 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! ;)

kingswhale 6Oct2011 21:52

Re: Copying an existing table to a new table in MySQL
 
i love this post, but am still a leaner. so one day i will come out shining

mukeshsoftona 3Nov2011 15:37

Re: Copying an existing table to a new table in MySQL
 
Hey dear!

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


All times are GMT +5.5. The time now is 07:20.