如何求被另一组分组的每个组的总和?
我实际上正在尝试使用 Oracle Analytics 工具和 PL/SQL 制作矩阵表。
假设我有一个查询,其中包含 select 语句变量 Employee、Description、orderid、amount,并按 Employee、Description 进行分组。 Orderid 和 amount 属于同一组。从这个查询中,我想提取所有员工的每个描述的金额总和。你知道我该怎么做吗?
谢谢。
编辑: 假设我们有以下查询:
Select Employee, Description, orderid ,amount
From Employees
Group by Employee,Description
我想从每个描述组中提取金额总和,但从所有员工中提取金额总和。执行此操作的方法可能如下所示:
Select Description,sum(amount)
From Employees
Group by Description
但实际查询要复杂得多,如果我选择创建另一个查询为了查找每个描述的总和,我必须以某种方式将其链接到第一个查询,以便能够在报告中显示结果。 您是否知道通过 Oracle Analytics Publisher 实现此目的的方法?
谢谢。
I am actually trying to make a matrix table using Oracle Analytics tool and PL/SQL.
Let's say i have a query which has in select statement variables Employee, Description, orderid ,amount and is grouped by Employee, Description. Orderid and amount belong to the same group. From this query i want extract the sum of the amount of each description from all employees. Do you have any idea how i can do this?
Thank you.
Edit:
Let's say we have the following query:
Select Employee, Description, orderid ,amount
From Employees
Group by Employee,Description
I want to extract the sum of amount from each Description group but from all Employees.A way to do this could be like this:
Select Description,sum(amount)
From Employees
Group by Description
But the actual query is much more complex and if i choose to make another query for finding the sum of each description i have to link it somehow to the first query to be able to show the results at the report.
Do you have any idea of a way to do this through oracle analytics publisher?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)