如何对 oracle apex 集合中的列求和
所以我试图输出集合中一列的总计。
这是我尝试的第一个查询
select sum(C007),sum(C007) A FROM APEX_COLLECTIONS WHERE COLLECTION_NAME='PURCHASE'
这是我尝试的第二个查询
select sum(C005*C007),sum(C005*C007) A FROM APEX_COLLECTIONS WHERE COLLECTION_NAME='PURCHASE'
两者都产生相同的结果,列出了列中的所有值,而不是求和
预期结果:
10
实际结果:
2
2
2
2
2
请帮助
So I am trying to output the total of a column from a collection.
This is the first query I tried
select sum(C007),sum(C007) A FROM APEX_COLLECTIONS WHERE COLLECTION_NAME='PURCHASE'
This is the second query I tried
select sum(C005*C007),sum(C005*C007) A FROM APEX_COLLECTIONS WHERE COLLECTION_NAME='PURCHASE'
Both produce the same result which list out all the values in the column insted of suming them
Expected Results:
10
Actual Results:
2
2
2
2
2
Please help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来你做错了什么。
我创建了示例页面;它包含一个按钮(仅提交页面)和一个显示总计(集合值的总和)的项目。项目由包含所有内容的进程填充(为简单起见):
运行时(按下按钮后),项目的值是 - 正如预期的 -
300
。Looks like you did something wrong.
I created sample page; it contains a button (which will just submit the page) and an item which will display total (sum of collection's values). Item gets populated by a process which contains everything (for simplicity):
When ran (and after button was pressed), item's value is - as expected -
300
.