题解 | #月均完成试卷数不小于3的用户爱作答的类别#
月均完成试卷数不小于3的用户爱作答的类别
https://www.nowcoder.com/practice/b1d13efcfa0c4ecea517afbdb9090845
# 找到谁是‘当月均不小于3’
# select uid
# from exam_record
# group by uid,date_format(submit_time,'%Y%m')
# having count(submit_time)>=3
select tag,count(start_time) tag_cnt
from examination_info ei left join exam_record er using(exam_id)
where uid in (
select uid
from exam_record
group by uid,date_format(submit_time,'%Y%m')
having count(submit_time)>=3
)
group by tag
order by tag_cnt desc