题解 | #SQL类别高难度试卷得分的截断平均值#

月均完成试卷数不小于3的用户爱作答的类别

http://www.nowcoder.com/practice/b1d13efcfa0c4ecea517afbdb9090845

select
tag
,count(tag) tag_cnt
from exam_record r
join examination_info i
on r.exam_id=i.exam_id
where uid in (
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
)
group by tag
order by tag_cnt desc
这题相当于大总结,需要理清楚关系。
全部评论

相关推荐

M_bao:换个排版吧哥们,看着费劲
点赞 评论 收藏
分享
评论
2
1
分享
牛客网
牛客企业服务