当前位置: 代码迷 >> Sql Server >> 关于Update,该怎么解决
  详细解决方案

关于Update,该怎么解决

热度:60   发布时间:2016-04-24 21:33:18.0
关于Update
以下是语句:
Update ShipDateQtyPush 
Set ShipDateQtyPush.Sam331=(Select Sam from ProcessQty where ProcessID='331') 
where ShipDateQtyPush.PO=ProcessQty.PO

执行的时候老是提示:
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "ProcessQty.PO" could not be bound.
请问该如何修改?

------解决方案--------------------
update a set a.sam331=b.sam from 
ShipDateQtyPush  a,ProcessQty b
where b.ProcessID='331' and a.po=b.po
------解决方案--------------------
try this,

Update a 
 Set a.Sam331=b.Sam 
 from ShipDateQtyPush a
 inner join ProcessQty b on a.PO=b.PO and b.ProcessID='331'
  相关解决方案