sogofun:SQL语句问题

来源:百度文库 编辑:神马品牌网 时间:2024/05/10 23:10:21
把表1中符合要求的某个字段的值A,拿A去更新表2中某字段的值B,这个语句怎么写啊?

update 表2 set 字段=(select 表1 from 字段 where 字段=值A ) where 字段=值B

vbscript里面是这样写的。

select .......

update 表2名 set B值字段名 in (select A值字段名 from 表1名 where 条件) where 条件

能看懂吧

select 某个字段A
from 表1
where 某个字段A的条件
update 表2
set (...)
value(...)