Update several records in a table using another table

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)
 
J

John Spencer (MVP)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top