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


