题解 | #每月及截止当月的答题情况#

每月及截止当月的答题情况

https://www.nowcoder.com/practice/1ce93d5cec5c4243930fc5e8efaaca1e

with zb4 as(with zb2 as (select uid,date_format(start_time,'%Y%m') start_month,start_time,first_value(start_time)
over(partition by uid order by start_time) zc_time
from exam_record)
select start_month,count(distinct uid) mau,sum(if(start_time=zc_time,1,0)) month_add_uv
from zb2
group by start_month
)
select *,max(month_add_uv) over(order by start_month) 	max_month_add_uv,
sum(month_add_uv) over(order by start_month) cum_sum_uv
from zb4
order by start_month

全部评论

相关推荐

06-27 12:30
延安大学 C++
实习+外包,这两个公司底层融为一体了,如何评价呢?
一表renzha:之前面了一家外包的大模型,基本上都能答出来,那面试官感觉还没我懂,然后把我挂了,我都还没嫌弃他是外包,他把我挂了……
第一份工作能做外包吗?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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