How to insert data from one table to another


To insert records from table to another, run the following command:

insert into table_name select fields1,field2…from table_name;

example:

mysql> insert into EXAMPLE select FIRST,LAST from TEST;

To insert records from table to another without duplicate, run the following command:

insert ignore into table_name select fields1,field2… from table_name;

example:

mysql> insert ignore into EXAMPLE select FIRST,LAST from TEST;

Comments are closed.