Update several records in a table using another table

  • Thread starter Thread starter tunelady
  • Start date Start date
T

tunelady

Okay you wizards, I thought I knew this stuff but
apparently not too well. I'm basically trying to replace
some fields according to criteria in another table.

An example of what I put in there was this and it doesn't
work:

update table1 set table1.value1=table2.job2 where
table2.job1=table1.value1


table2.job2 should replace table1.value1 when the data
matches between job1 and value1

What am I doing wrong...I'm sure it's something really
simple!

(e-mail address removed)
 
UPDATE Table1 INNER JOIN Table2
ON Table1.Value1 = Table2.Job2
SET Table1.Value1 =Table2.Job2

Although this makes no sense at all, since the you are replacing matching values
with matching values.
 
Back
Top