MySQL跨表更新SQL

1 sql范式  把s表中的city_name的值设置为city表中的name,关联条件是city_code 和 code

update student s, city c
   set s.city_name = c.name
 where s.city_code = c.code;

  

posted @ 2019-09-29 10:32  Questions张  阅读(346)  评论(0编辑  收藏  举报