题解 | #月均完成试卷数不小于3的用户爱作答的类别#
月均完成试卷数不小于3的用户爱作答的类别
https://www.nowcoder.com/practice/b1d13efcfa0c4ecea517afbdb9090845
select ei.tag as tag, count(*) as tag_cnt from exam_record er left join examination_info ei on er.exam_id = ei.exam_id inner join ( SELECT distinct uid FROM exam_record where submit_time is not null GROUP BY uid, month(submit_time) HAVING count(submit_time) > 2 ) u on er.uid = u.uid group by tag order by tag_cnt desc