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

月总刷题数和日均刷题数

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 ;
	这题目还是挺难的

全部评论

相关推荐

10-09 22:05
666 C++
找到工作就狠狠玩CSGO:报联合国演讲,报电子烟设计与制造
点赞 评论 收藏
分享
把球:这个听过,你加了就会发现是字节的hr
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务