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

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

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

select tag,
	count(start_time) tag_cnt	# 计算作答次数
from exam_record er inner join examination_info ei 
	on er.exam_id = ei.exam_id 
where uid in (select uid	# 子查询确定uid 在“当月均完成试卷数”不小于3的用户们
	from exam_record
	where date_format(start_time,'%Y-%m') = '2021-09'
	group by uid
	having count(submit_time) >= 3)	
group by tag
order by tag_cnt desc;

全部评论

相关推荐

嵌入式求职之路:可以看我经验😂,https://www.nowcoder.com/share/jump/73221730841876945
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务