MySQL社区

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 1980|回复: 2
打印 上一主题 下一主题

[SQL类] 【求助】一个复杂的更新

[复制链接]
跳转到指定楼层
1#
发表于 2014-7-21 18:02:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
现在有三个表
A,B,C
A表中ID ==B表ID

现在 要将
C表的UserAccount ,根据A表的UserAccount 全部替换成B表中的UserAccount
求助先要要怎么办


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 分享淘帖 顶 踩
2#
发表于 2014-7-22 09:57:30 | 只看该作者
C表和A、B表什么关系?

猜测:
update A,B,C set A.UserAccout=B.UserAccout
where A.ID=B.ID and A.UserAccout=C.UserAccout;
3#
发表于 2014-7-22 14:15:17 | 只看该作者
C表的UserAccount ,根据A表的UserAccount 全部替换成B表中的UserAccount

没看懂这句什么意思
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|申请友链|小黑屋|Archiver|手机版|MySQL社区 ( 京ICP备07012489号   
联系人:周生; 联系电话:13911732319

GMT+8, 2024-5-4 10:40 , Processed in 0.065206 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表