MySQL workbench copy from table to table.

Asked By 10 points N/A Posted on -
qa-featured

Hi Experts,

I want to MySQL workbench copy from table to table. And I tried with this code "CREATE TABLE recipes_new LIKE production. recipes; INSERT recipes_new SELECT * FROM production. recipes;" but it won't work. What can I do now? Can anyone help me?

SHARE
Best Answer by Russel C Brannon
Answered By 0 points N/A #198176

MySQL workbench copy from table to table.

qa-featured

 

Try this in the sql command window…

INSERT IGNORE INTO new_tbl SELECT *FROM production. recipe;

The IGNORE is only necessary if there might be duplicate keys. Of course, those records won't get copied over.

 

Answered By 0 points N/A #143901

MySQL workbench copy from table to table.

qa-featured

Hi

You can try the below command

INSERT INTO `table2` (`field_name2`) SELECT `field_name` FROM `table1`

if you mean you want to update column from column of another table then try given below command

UPDATE table1 AS t1
  INNER JOIN table2 AS t2 ON t1.EmpoyeeNo = t2.EmployeeNo
SET t1.SomeColumn = t2.SomeColumn

Hope this will solve your problem

Thanks

McNabb

Best Answer
Best Answer
Answered By 10 points N/A #198177

MySQL workbench copy from table to table.

qa-featured

Hi CHristopherrsimonn,

Yes, I can help you with this.

Steps Required are as follows,

Establish and Connect to Database

Go To Manage Import / Export

Go To Data Export

Select Databases and Tables

Export to Dump Project Folder

Start Export

Or see

Right click the table choose, "Send to SQL Editor -> Create Statement"

Select all and execute the statement

Change table name

Then execute the statement:

INSERT INTO `table2` SELECT * FROM `table1` 

 

Use the following video tutorial for your understanding,

Hope this helps you.

Thanks,

 

Related Questions