好的..我确定我有一个大脑放屁的时刻..但由于某种原因我无法让这个更新工作。我有 2 个表,我非常想将信息从 8 列复制到另一个表的 8 列。..这是我到目前为止所拥有的
update a
set a.denialcharge_cost = b.denial_cost
, a.epd_cost = b.early_default_payment
, a.expeditecharge_cost = b.expeditecharge
, a.duediligence_cost = b.duediligence
, a.deskreview_cost = b.deskreview
, a.servicing_cost = b.servicingcharge
, a.mers_cost = b.merscharge
, a.qcplans_cost = b.qcplans
from orderheader a
inner join clients b
on a.prnt_id = b.id
我得到了错误
Msg 512, Level 16, State 1, Procedure UpdateOrderHeader, Line 13
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.
我在客户端中有 x 个客户..在 orderheader 中有 y 个订单..每个订单可以有 1 个客户..每个客户可以有多个订单...orderheader 中的 prnt_id 在客户表中具有 id....任何帮助将不胜感激...我正在尝试将 denial_cost、early_default_payment、expeditecharge、duediligence、deskreview、servicescharge、merscharge、qcplans 从客户复制到 orderheader