Convert UPDATE with INNER JOIN from SQL for use in MySQL

前端 未结 4 2060
醉酒成梦
醉酒成梦 2021-01-07 03:40

I\'d like to convert this for us in MySQL:

UPDATE product 
SET price = 12.95 
FROM product 
    INNER JOIN product_to_category ON product.product_id = produc         


        
4条回答
  •  执念已碎
    2021-01-07 04:20

    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)
    

提交回复
热议问题