有两张表,一张class信息表,一张student信息表,但student表里的信息存在错误,需要用class表中的信息去更新student表数据。
update student_info s, class_info c set s.class_name = c.class_name where s.class_id = c.class_id
【结果】:通过关联字段关联上的数据,内容相应更新;没关联上的,内容不变。