update left join 语句求解答

chenstu 2007-11-19 09:53:19

UPDATE a
SET price=c.price
from (select a.oldcode from a WITH (nolock)
left join b with (nolock) on a.codeid=b.codeid
left join c with(nolock)
on a.stu=c.stu and c.id='value'
where b.pdid='00' and a.price is null))

请问我这样子更新是否是正确的呢?
...全文
1611 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenstu 2007-11-26
  • 打赏
  • 举报
回复
谢谢各位的答案
hzl620 2007-11-19
  • 打赏
  • 举报
回复
FROM中间我没有看懂,其它要是后面))是笔误,那其它都是对的
中国风 2007-11-19
  • 打赏
  • 举报
回复
--不能把表()起来,放在外连
update a
set price=c.price
from
a with(Nolock)
left join
b with(Nolock) on a.codeid=b.codeid
left join
c with(nolock) on a.stu=c.stu and c.id= 'value '
where b.pdid= '00 ' and a.price is null
中国风 2007-11-19
  • 打赏
  • 举报
回复

--改一下
set price=c.price
from
a with(Nolock)
left join
b with(Nolock) on a.codeid=b.codeid
left join
c with(nolock) on a.stu=c.stu and c.id= 'value '
where b.pdid= '00 ' and a.price is null
cxmcxm 2007-11-19
  • 打赏
  • 举报
回复
UPDATE       a   
SET price=c.price
from a WITH (nolock)
left join b with (nolock) on a.codeid=b.codeid
left join c with(nolock)
on a.stu=c.stu and c.id= 'value '
where b.pdid= '00 ' and a.price is null

34,576

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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