运行以下脚本时,我收到以下错误。任何帮助,将不胜感激。
子查询返回超过 1 个值。当子查询跟随 =、!=、<、<=、>、>= 或子查询用作表达式时,这是不允许的。
脚本
DROP TABLE ProductBase_TEMP
GO
SELECT *
INTO ProductBase_TEMP
FROM PILOT.dbo.PART
GO
UPDATE ProductBase
SET CurrentCost =
(SELECT ProductBase_temp.UNIT_LABOR_COST + ProductBase_temp.UNIT_BURDEN_COST + ProductBase_temp.UNIT_SERVICE_COST AS VISUAL_Cost
FROM ProductBase INNER JOIN
ProductBase_temp ON ProductBase.ProductNumber = ProductBase_TEMP.ID COLLATE Latin1_General_CI_AI)
WHERE (ProductNumber COLLATE Latin1_General_CI_AI =
(SELECT ProductBase_temp.ID
FROM ProductBase_temp INNER JOIN
ProductBase ON ProductBase_temp.ID COLLATE Latin1_General_CI_AI = ProductBase.ProductNumber))
谢谢