两张表更新问题~十万火包

qq4004229 2008-05-05 06:06:13

update TeachingPractise
set a.textid=b.id
from TeachingPractise as a inner join textarticle as b on a.bookcode =b.code and inputtime='20080505'


错误提示
消息 4104,级别 16,状态 1,第 1 行
无法绑定由多个部分组成的标识符 "a.textid"。
...全文
94 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq4004229 2008-05-06
  • 打赏
  • 举报
回复
好了结帐。。6楼的正解。。。
感谢谢大家
songhuan 2008-05-05
  • 打赏
  • 举报
回复

update TeachingPractise set textid=
(select id from textarticle where code=(select bookcode from TeachingPractise where inputtime='20080505' ))
where inputtime='20080505'


行不行?
m2741454 2008-05-05
  • 打赏
  • 举报
回复
update TeachingPractise
set TeachingPractise.textid=b.[id ]
from TeachingPractise inner join textarticle as b on TeachingPractise.bookcode =b.code and inputtime='20080505'

更新的表a.textid 和update TeachingPractise 不相同无法绑定
贫僧又回来了 2008-05-05
  • 打赏
  • 举报
回复
先把你要的字段放入临时表
select ……into #a
再UPDATE TeachingPractise
试试看!呵呵
qq4004229 2008-05-05
  • 打赏
  • 举报
回复
消息 4104,级别 16,状态 1,第 1 行
无法绑定由多个部分组成的标识符 "textarticle.code"。
yangshun2008 2008-05-05
  • 打赏
  • 举报
回复
update 里面能有from ???

update TeachingPractise
set TeachingPractise.textid=textarticle.id
where TeachingPractise.bookcode =textarticle.code
and inputtime='20080505'
badtank 2008-05-05
  • 打赏
  • 举报
回复
update TeachingPractise
set a.textid=b.id
from textarticle
where TeachingPractise.bookcode =textarticle.code
and inputtime='20080505'
mylibin 2008-05-05
  • 打赏
  • 举报
回复
修改应该不能用连接修改吧

111,125

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧