Last updated on August 7th, 2022 at 06:58 pm

This code will help us copy content from one table to another, we can use single column or multiple according to your requirement.

Let us assume the table with the name table_1 and we would like to copy column named email from that table to another table with the name table_2.

INSERT INTO table_2 (email) SELECT email FROM table_1 WHERE email='[email protected]';

As you can see both have the same column named email. It is not mandatory to have the same column name but make sure you specify the name of the column in the INSERT command as shown

Leave a Reply

Your email address will not be published. Required fields are marked *