+ -
当前位置:首页 → 问答吧 → 快来抢分,很简单的SQL问题。。。关于两个表的操作

快来抢分,很简单的SQL问题。。。关于两个表的操作

时间:2011-09-06

来源:互联网

我有表A 字段有 a ,b
表B字段有a,b
当表A中的a等于表B中的b时,我想update 表A的a值为B中的b
具体的SQL语句是怎么样的呢?

作者: x110700305   发布时间: 2011-09-06

作者: luckyzhangye   发布时间: 2011-09-06

update A set A.a=(select B.b from A where A.a=B.b) where exists (select 1 from B where A.a=B.b);

作者: xieyijun1986   发布时间: 2011-09-06

update A set A.a=(select B.b from B where A.a=B.b) where exists (select 1 from B where A.a=B.b);

作者: xieyijun1986   发布时间: 2011-09-06

update A set A.a=(select B.b from B where A.a=B.b) where exists (select 1 from B where A.a=B.b);

作者: yms_wangxm   发布时间: 2011-09-06

好像描述有问题吧 ??????

作者: yms_wangxm   发布时间: 2011-09-06

热门下载

更多