我有2个这样的查询:
Select F_Exhibitor,F_Stand from t_order_header where F_Exhibition='10996'
和
select F_ExhibitorCode,F_Stand from T_ExhibitorLocation where F_ExhibitionCode='10996'
我想在T_ExhibitorLocation中使用相应的F_ExhibitorCode和F_stand名称更新T_order_header
表F_stand
答案 0 :(得分:1)
希望能够正确理解请求,更新查询可能类似于
UPDATE o
SET o.F_Stand = e.F_Stand
FROM t_order_header o INNER JOIN T_ExhibitorLocation e ON e.F_ExhibitionCode = F_Exhibition
--optional where code
答案 1 :(得分:0)
UPDATE t_order_header
SET F_STAND = A.F_STAND
FROM
(SELECT F_ExhibitorCode,F_Stand
FROM T_ExhibitorLocation
WHERE F_ExhibitionCode='10996')A // What's that A ?
WHERE A.F_ExhibitorCode=F_Exhibitor
现在尝试.....