天天看點

mysql 聯表更新資料

如題,兩張資料庫表 t_a, t_b, 需要把t_a表中的字段a_col指派為t_b表中的字段b_col,兩表關聯的字段分别是a_line,b_line。

sql語句如下:

update t_a a, t_b b set a.a_col = b.b_col where a.a_line=b.b_line;

繼續閱讀