`
maqianli
  • 浏览: 175172 次
  • 性别: Icon_minigender_1
  • 来自: 长春市
社区版块
存档分类
最新评论

双表联合Update

阅读更多

将tab1的psw改为tab2的password 
tab1.id=tab2.id 

且tab1与tab2数据一一对应,不能出现一对多的情况.


update tab1 set tab1.psw = (select tab2.password from tab2 where tab2.id = tab1.id) where tab1.id in (select tab2.idfrom tab2) 

1
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics