UPDATE Recipes RE, (
SELECT SUM((((i.iCaseCost/i.iCaseQty)/i.iUnitSize)/i.iUnitSoldBy)*ri.riQty*ri.riMeasureBy) AS 'RecipeCost'
FROM Recipes r INNER JOIN RecipeIngredients ri
ON r.rID = ri.rID JOIN Ingredients i
ON ri.iID = i.iID
WHERE ri.rID = RE.rID
) t
SET RE.rYieldCost = t.RecipeCost
执行时,我收到以下错误:“'where 子句'中的未知列'RE.rID'”。
有任何想法吗?