Thursday, April 19, 2012

Import records from another table and another database

How to insert records from one table to another table in a single query

insert into first_tablename select * from second_table_name

create table and import records from another database

CREATE TABLE recipes_new LIKE production.recipes; INSERT recipes_new SELECT * FROM production.recipes;

Insert table records from another database

INSERT dbname.table_name SELECT * FROM dbname1.tablename1

No comments:

Post a Comment