SQL 使用 JOIN 更新查询

SQL UPDATE query with JOIN

我已经搜索并解决了之前所有关于它的问题和答案,但我就是找不到做我想做的事情的好方法,所以也许我的问题也可以帮助其他人,让我们看看。

我正在尝试使用此 SQL 查询:

UPDATE L

   SET L.description = REPLACE(L.description, '196,99', '197') 

  FROM ps_product_lang AS L 
  JOIN ps_product AS P 
    ON L.id_product = P.id_product



 WHERE P.id_category_default = 23

替换 ps_product_lang table 中的字符串,第 列描述

WHERE 子句必须匹配来自 ps_product table 的 ID(第 id_category_default)

这里有什么问题?

UPDATE ps_product_lang AS L 

  JOIN ps_product AS P 
    ON L.id_product = P.id_product

   SET L.description = REPLACE(L.description, '196,99', '197') 

 WHERE P.id_category_default = 23