题解 | #分别满足两个活动的人#
分别满足两个活动的人
https://www.nowcoder.com/practice/a126cea91d7045e399b8ecdcadfb326f
select uid,'activity1' as activity from exam_record group by uid having (sum(score) / count(uid)) >= 85 union all select uid,'activity2' as activity from exam_record er left join examination_info ei on er.exam_id = ei.exam_id where difficulty = 'hard' and score >= 80 and submit_time is not null and timestampdiff(second,start_time,submit_time) <= duration*30 order by uid 难点: 1. 如何表示每次分数都在85分以上 2.如何表示一半时间