update sys_user t1 left join ( select student_id ,count(1) as num from edu_class_record where begin_time > '2023-09-22 00:00:00' and classification = 2 GROUP BY student_id ) t2 on t1.user_id = t2.student_id set t1.teacher_time = t1.teacher_time - t2.num where t2.num > 0