,a.finishtime=case when a.finishtime is null and c.atime * 60 <= d.totstudy then now() else null end -> ,a.finishtime=case when a.finishtime is null and c.atime * 60 <= d.totstudy then now() else a.finishtime end