Skip navigation links

MySQL Forums :: Transactions :: Copy data from one table to another table


Advanced Search

Copy data from one table to another table
Posted by: John Edwards ()
Date: August 24, 2009 11:26PM

Hi,

I would like to copy the data from 'table_1' 'column_1' into 'table_2' 'column_1'.

There are only 3 rows in table_1.data_1 which I need to copy exactly however will need to run this every 10 seconds.

When running the query below it does't update the values in table_2 correctly (See below)

UPDATE table_1, table_2 SET table_2.column_1 = table_1.column_1;

table_1.column_1
apples
pears
apples

table_2.column_1
apples
apples
apples

Query OK, 0 rows affected (0.00 sec)
Rows matched: 3 Changed: 0 Warnings: 0

How can I get each row to update so both tables_1 and table_2 are exactly the same?

Thanks

Options: ReplyQuote


Subject Views Written By Posted
Copy data from one table to another table 14119 John Edwards 08/24/2009 11:26PM
Re: Copy data from one table to another table 4890 John Edwards 08/25/2009 12:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.