题解 | #月均完成试卷数不小于3的用户爱作答的类别#
月均完成试卷数不小于3的用户爱作答的类别
http://www.nowcoder.com/practice/b1d13efcfa0c4ecea517afbdb9090845
from exam_record er
left join examination_info ei
on er.exam_id = ei.exam_id
where er.uid in
(
select uid from
(select uid,month(start_time) as month ,count(month(start_time)) as con_cnt
from exam_record
where submit_time is not null
group by uid,month) t1
group by uid
having avg(con_cnt)>=3
)
group by ei.tag
order by tag_cnt desc