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

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

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

全部评论

相关推荐

滴滴 后端 薪资n x(15-18),普遍15,3w签字费,12%公积金
来个offer吧求求求:同理想offer,不敢去啊,理想有毁三方裁应届的先例
点赞 评论 收藏
分享
无情咸鱼王的秋招日记之薛定谔的Offer:好拒信,偷了,希望有机会用到
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务