题解 | #计算用户8月每天的练题数量#

计算用户8月每天的练题数量

https://www.nowcoder.com/practice/847373e2fe8d47b4a2c294bdb5bda8b6

select substr(date,9,2) day,count(question_id) question_cnt 
from question_practice_detail
where substr(date,1,7)='2021-08'
group by day

先选择select需要的两个字段,这里我day用的截取,然后count下题目数量,在where子句中依旧是截取date字段,从1位置开始截取7位来限制时间,最后分组排序下就好了

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务