【发布时间】:2021-09-19 04:49:42
【问题描述】:
我有这张桌子。我需要数数:
- 累计积木总数(total_count)
- 每种颜色累计的积木数量 (running_total_per_colour)
brick_id colour shape weight
1 blue cube 1
2 blue pyramid 2
3 red cube 1
4 red cube 2
5 red pyramid 3
6 green pyramid 1
我怎样才能用 SQL 做到这一点
【问题讨论】:
-
编辑您的问题并显示您想要的结果。
-
@GordonLinoff 是的,我正在寻找窗口函数。
-
@GordonLinoff 是的,非常感谢!