Access 连表查询语法
发布时间:2020-12-12 14:56:02 所属栏目:MsSql教程 来源:网络整理
导读:? 目的是想把b表的img字段内容更新到a表的img字段上,没想到sql的语法在access里竟然不支持! update [member_inf] set [img] =(select [img] from [img] where [id]=1) ? where [id]=1? 提示不可更新字段 百度之后才知道access用的Jet-SQl,SqlServer用的是T-S
?
目的是想把b表的img字段内容更新到a表的img字段上,没想到sql的语法在access里竟然不支持! update [member_inf] set [img] =(select [img] from [img] where [id]=1)
where [id]=1? 提示不可更新字段 百度之后才知道access用的Jet-SQl,SqlServer用的是T-SQl. ? ? 正确语法: UPDATE A,B SET a.x = B.y,... WHERE a.z = b.z [AND a.z='']
? 我是这样写的,测试可以 update [member_inf] as t1,[img] as t2 set t1.[img]=t2.[img] where t1.[id]= t2.[id] and t1.[id]=1
? 今天帮朋友写一个小网站的程序,数据库用的ACCESS,因为需要将某个类下的子类个数更新到该类的Child字段,于是我写了这样一个查询 |