我正在尝试更新一个表中的记录,该记录依赖于另一个表中的行。像这样:
UPDATE product_description SET description="" /* Nothing! */
WHERE product.product_id=product_description.product_id AND product.manufacturer_id=1
最佳答案
UPDATE product_description
JOIN product ON product.product_id = product_description.product_id
SET description = "" /* Nothing! */
WHERE product.manufacturer_id = 1
关于mySQL Update 字段依赖于 Select,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28340662/