我正在尝试使用同一表中另一组记录的值更新表中的一组记录。当我运行此查询时,出现错误:
消息 4104,级别 16,状态 1,行 1
无法绑定多部分标识符“t.com”。
代码:
update tphase
set
t.com = t.com + b.com,
t.direct = t.direct + b.direct,
t.fee = t.fee + b.fee,
t.fringe = t.fringe + b.fringe,
t.fte = t.fte + b.fte,
t.ganda = t.ganda + b.ganda,
t.hours = t.hours + b.hours,
t.overhead = t.overhead + b.overhead,
t.fccmga = t.fccmga + b.fccmga,
t.fccmoh = t.fccmoh + b.fccmoh,
t.lbroh = t.lbroh + b.lbroh,
t.ms = t.ms + b.ms
from
tphase t
inner join
(select *
from tphase
where program = 'xenon' and
class = 'earned' and
df_date > '2013-05-03'
) as b on t.program = b.program and
t.cawpid = b.cawpid and
t.class = b.class and
t.cecode = b.cecode
where
t.program = 'xenon' and
t.class = 'earned' and
t.df_date = '2013-05-03' ;