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

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

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

全部评论

相关推荐

牛客279957775号:铁暗恋
点赞 评论 收藏
分享
11-01 08:48
门头沟学院 C++
伤心的候选人在吵架:佬你不要的,能不能拿户口本证明过户给我。。球球了
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务