知道可以使用什么功能或逻辑来实现此输出?
问题:
表A具有一个带有4个值
col 1
-----
1
2
5
8
输出
col 1 col 2
----- -----
1 2
2 10
5 40
8 8
的一列,应该是现有的列,该列具有累积产品的派生列。当没有更多值可乘以时,应按原样显示行值。累积总和可以轻松计算。知道如何实现乘法吗? 我尝试使用OLAP功能,但没有运气。
Question:
Table A has one column with 4 values
col 1
-----
1
2
5
8
Output
col 1 col 2
----- -----
1 2
2 10
5 40
8 8
Output should be the existing column with a derived column that is a cumulative product. When there are no more values to multiply with, the row value should be displayed as is. Cumulative sum can be calculated easily. Any idea how multiplication can be achieved?
I tried using OLAP functions, but no luck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的预期输出是当前和下一行的产物:
Your expected output is the product of the current and the next row: