欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

mysql用一個表更新另一個表的方法

 更新時間:2017年01月03日 10:49:32   投稿:jingxian  
下面小編就為大家?guī)硪黄猰ysql用一個表更新另一個表的方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

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);

以上這篇mysql用一個表更新另一個表的方法就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關文章

最新評論