I need to update multiple rows in a table.
i have table customer
and contact
I need to update customer
where the linked contact in the contact
table has the column city
at a certain value.
I can get the rows i need with this query
Select cus.id, con.city
from customer cus, contact con
where cus.contacts_id=con.id
and con.city="MyValue"
I know how to update one table but do not understand how to update the table when the rows are looked up from a different table.
and con.city="MyValue"
will result in an error unless you have a column namedMyValue
somewhere. String constants need to be enclosed in single quotes in SQL.