Solution 1: 修改1列(navicate可行) 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: 采用子查询(navicate不可行) update student s set city_n…
MySQL将表a中查询的数据插入到表b中 假设表b存在 insert into b select * from a; 假设表b不存在 create table b as select * from a; 扩展: 将b表中的某写字段值插入到a表中 insert into a (userID,userName) select b.userID,b.userName from tr_ajax_chat_messages; 将a表和b表userID相等的值保存到a表 update a set a.use…