当前位置: 代码迷 >> Sql Server >> 出现表不明确解决方案
  详细解决方案

出现表不明确解决方案

热度:58   发布时间:2016-04-27 18:51:18.0
出现表不明确
update   cardinfo   set   preamt=b.curamt   from   cardinfo   a   ,   cardinfo   b   where   a.cardid   =b.cardid   and   a.updatedate   = '2007-01-01 '   and   b.updatedate   =dateadd   (   dd   ,   -   1   ,   '2007-01-01 '   )     ;


------解决方案--------------------
update a --用别名
set
preamt=b.curamt
from
cardinfo a , cardinfo b
where
a.cardid =b.cardid
and
a.updatedate = '2007-01-01 '
and
b.updatedate =dateadd ( dd , - 1 , '2007-01-01 ' )
  相关解决方案