我想在MySQL中为我们转换一下:
UPDATE product SET price = 12.95 FROM product INNER JOIN product_to_category ON product.product_id = product_to_category.product_id INNER JOIN category ON product_to_category.category_id = category.category_id AND category.parent_id = 39
MySQL不喜欢FROM部分,而且我不确定INNER JOINs是否能像编写的那样工作。
UPDATE product SET price = 12.95 WHERE product_id in (SELECT product_id FROM product_to_category INNER JOIN category ON product_to_category.category_id = category.category_id WHERE category.parent_id = 39)