mysql中获取累计数据

有较长一段时间没写SQL,最近快速的捡起遗忘的一些点
语法:

sum(字段1) over(partition by 字段2 order by 字段3 rows between unbounded preceding and current row) as 新字段名

参考:
https://blog.csdn.net/weixin_43332500/article/details/105033468

猜你喜欢

转载自blog.csdn.net/The_dream1/article/details/122818779
今日推荐