最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
mysql用一个表更新另一个表的方法介绍
时间:2017-01-05 编辑:简简单单 来源:一聚教程网
Solution 1: 修改1列
update student s, city c
set s.city_name = c.name
where s.city_code = c.code;
Solution 2: 修改多个列
update a, b
set a.title=b.title, a.name=b.name
where a.id=b.id
Solution 3: 采用子查询
update student s set city_name = (select name from city where code = s.city_code);
-
上一个: Mybatis查询延迟加载详解及实例
相关文章
- 深入分析MySQL更新死锁问题 08-27
- Ubunut 14.04中mysql-apt-config选择更新版本无反应 03-12
- MySQL登录、访问及退出操作解析 10-18
- sql语句 update字段null不能用is null问题解析 09-28
- SQL Server ISNULL 不生效原因及解决分析 09-28
- 关于if exists的用法及说明分析 09-28