第二题答案 select b.month "月份", b.mon_amount "当月销售金额", sum(b.mon_amount)over(partition by b.year order by b.month) "累计销售金额"from(select a.month,a.year,sum(a.amount) as mon_amountfrom(select id,user_id,paid_time,substr(paid_time,1,7) as month,substr(paid_time,1,4) as year,amountfrom order_record order by paid_time) agroup by a.month,a.yearorder by a.month) b
点赞 1

相关推荐

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