2 messages in com.mysql.lists.mysqlinserting values from another table
FromSent OnAttachments
Nik Belajcic27 Apr 2004 18:24 
Paul DuBois27 Apr 2004 19:04 
Subject:inserting values from another table
From:Nik Belajcic (nik.@nbrsap.com.au)
Date:04/27/2004 06:24:49 PM
List:com.mysql.lists.mysql

Hello,

I just subscribed to the list (after a few years of absence) and have a rather basic question -

I have two tables table1 and table2:

table1 - primarykey1, foreignkey, somevalue table2 - primarykey2, somevalue

Both tables are populated with records, but foreignkey in table1 has no value.

I want to copy primarykey2 from table2 into foreignkey in table1 for records where table1.somevalue=table2.somevalue

If my understanding is correct, this should be straightforward with v4.1 where multitable UPDATE is supported, but since I am using 3.23.52 I think a different approach is required. If anyone can suggest a workaround, I would greatly appreciate it as I am not really an expert in this area.

Thanks in advance.