题解 | #月总刷题数和日均刷题数#

月总刷题数和日均刷题数

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

select date_format(submit_time,"%Y%m") submit_month,
        round(count(submit_time),3) month_q_cnt,
        any_value(round(count(submit_time)/day(LAST_DAY(submit_time)),3)) avg_day_q_cnt
    from practice_record
    where year(submit_time)='2021'
    group by submit_month

union all
select concat(year(submit_time),'汇总') submit_month,
        round(count(submit_time),3) month_q_cnt,
        round(count(submit_time)/31,3) avg_day_q_cnt
    from practice_record
    where year(submit_time)='2021'
    group by submit_month
    order by submit_month ;
	这题目还是挺难的

全部评论

相关推荐

拒绝无效加班的小师弟很中意你:求职意向没有,年龄、课程冗余信息可以删掉,需要提升项目经历。排版需要修改。
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务