Insert into select Mysql query example

We often looking for mysql query to copy data from one table to another table.To handle such kind of scenario using mysql query mysql we can use below mysql command.

INSERT INTO new_table (column1, column2, column3) SELECT old_table.column1,old_table.column2,old_table.column3 FROM old_table
Mysql Query to copy data from multiple tables to one table

INSERT INTO new_table (column1, column2, column3) SELECT old_table.column1,old_table1.column2,old_table2.column3 FROM old_table,old_table1,old_table2

For this command you can use join query as well.

Related posts:

The following two tabs change content below.

Chandra Shekhar

GCP Architect
Chandra Shekhar Pandey is Google certified Cloud engineer, I am Magento2 Trained developer. Having huge experience in designing cloud solution. I have around 12 years of experience with world enterprise IT companies and fortune 500 clients. During my architecture design I am always caring about high availability, fast performance and resilient system. From the programmer background I have huge experience in LAMP stack as well. Throughout my carrier I have worked on Retail, E-Learning, Video... Read More about Chandra Shekhar

Latest posts by Chandra Shekhar (see all)