首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

帮小弟我看看这个查询语句有什么有关问题

2012-12-31 
帮我看看这个查询语句有什么问题?update xx_hy_infoset xx_hy_info.hy_numb.hy_numfrom (select hy_id,su

帮我看看这个查询语句有什么问题?
update xx_hy_info  set xx_hy_info.hy_num=b.hy_num
from (select hy_id,sum(hy_num_move) as hy_num 
from hy_num_move_ls group by hy_id) b 
where xx_hy_info.hy_id=b.hy_id

上面语句在sql server中执行正常,但是把数据库换成access之后,就无法执行了,提示“操作符丢失”。什么原因呀?
[解决办法]

update xx_hy_info 
set xx_hy_info.hy_num=b.hy_num
from xx_hy_info a 
left join (select hy_id,sum(hy_num_move) as hy_num  from hy_num_move_ls group by hy_id) b  
on a.hy_id=b.hy_id

[解决办法]

--类似这样在情况
update bb b left join aa a on b.id = a.id set b.name = a.name



update 
xx_hy_info a 
left join (select hy_id,sum(hy_num_move) as hy_num  from hy_num_move_ls group by hy_id) b
on a.hy_id=b.hy_id
set a.hy_num=b.hy_num

  

热点排行