Hans Lernestål
Hans Lernestål

Reputation: 85

mySQL Update field dependent on Select

I am trying to update a record in one table that is dependent on a row in another table. Something like this:

UPDATE product_description SET description="" /* Nothing! */

WHERE product.product_id=product_description.product_id AND product.manufacturer_id=1

Upvotes: 0

Views: 59

Answers (1)

juergen d
juergen d

Reputation: 204784

UPDATE product_description 
JOIN product ON product.product_id = product_description.product_id 
SET description = "" /* Nothing! */
WHERE product.manufacturer_id = 1

Upvotes: 3

Related Questions