搜索多行数据合并成一行
select lesson.id,GROUP_CONCAT(student_id) from lesson LEFT JOIN roster ON roster.team_id=lesson.team_id and roster.logoff_time=0 group by lesson.id
更新某表中的某个数据段
UPDATE lesson INNER JOIN (select lesson.id,GROUP_CONCAT(student_id) as student_ids from lesson
LEFT JOIN roster ON roster.team_id=lesson.team_id and roster.logoff_time=0 group by lesson.id) AS T1
ON lesson.id=T1.id
SET lesson.student_ids=T1.student_ids