mysql通过子查询更新数据,下面这个有使用前提就是[主表的待数据为null,需要更新为附表中的值,有个前提是 子查询的数据唯一]:
update video set course_id = (select course_id from course_manage where course_manage.type = 'video' and course_manage.content_id = video.id) where video.course_id is null;
再复杂一点儿就需要使用存储过程的游标循环来做
