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

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

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

select
    day (date) day,
    count(id) question_cnt
from
    question_practice_detail
where
    year (date) = '2021'
    and month (date) = '08'
group by
    date

1、筛选条件 year (date) = '2021' and month (date) = '08'

2、查询中day 只显示多少号:day(date);question_cnt 通过计数count(id)即可(除了date列,选其他任意列都可)

全部评论

相关推荐

03-21 11:31
已编辑
门头沟学院 后端
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务