Trying to update a table using data from another table, and it doesn't like my syntax.
update tableA
set fieldA = 'Customer'
from tableA, tableB
where custnoA = custnoB
and fieldB = 'Customer'
and fieldA = ''
"Keyword FROM not expected. Valid tokens: SKIP WITH WHERE."
The error is that FROM is not a valid token, but I can not find an example where this is not valid SQL syntax.
What am I missing?
Basically what I am trying to do is if fieldB in tableB says "Customer", I want it to say "Customer" in fieldA in tableA if it is blank.
Many thanks!
update tableA
set fieldA = 'Customer'
from tableA, tableB
where custnoA = custnoB
and fieldB = 'Customer'
and fieldA = ''
"Keyword FROM not expected. Valid tokens: SKIP WITH WHERE."
The error is that FROM is not a valid token, but I can not find an example where this is not valid SQL syntax.
What am I missing?
Basically what I am trying to do is if fieldB in tableB says "Customer", I want it to say "Customer" in fieldA in tableA if it is blank.
Many thanks!
Comment