题解 | #月均完成试卷数不小于3的用户爱作答的类别#
月均完成试卷数不小于3的用户爱作答的类别
https://www.nowcoder.com/practice/b1d13efcfa0c4ecea517afbdb9090845
select b.tag,count(b.tag) tag_cnt from (select e.exam_id from (select uid from exam_record where submit_time is not null group by uid having count(exam_id) / count(distinct DATE_FORMAT(start_time, "%Y%m")) >= 3) t join exam_record e on t.uid= e.uid ) a join examination_info b on a.exam_id = b.exam_id group by b.tag order by tag_cnt desc