我想请您帮忙查询。我有一个带有 value(float)、attribute(nvarchar) 和 system(int) 的临时表。我需要根据属性更新值,但使用系统。所以...
UPDATE #inventory (value, attribute)
SET (value, attribute) = (SELECT SUM(value), 'Actual'
FROM ReportValue v, ReportValueType t, ReportProducts ti
WHERE v.type_id = t.id
AND v.voyage_id = ti.id
AND t.value_code = 'total'
AND t.category_code = 'cold'
AND ti.end_time BETWEEN @start AND @end)
UPDATE #inventory (value, attribute)
SET (value, attribute) = (SELECT SUM(value), 'Actual'
FROM ReportValue v, ReportType t, Reportprod ti
WHERE v.type_id = t.id
AND v.voyage_id = ti.id
AND t.field_name = 'Total'
AND t.slot_type = 'COLD'
AND t.xml_id = -2000
AND ti.end_time BETWEEN @start AND @end)
else (value, attribute)
end
这是错误的形式。我怎样才能让它工作?预先感谢您的回答!