Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to make a summary on one level of the query

user594312Oct 15 2012 — edited Oct 15 2012
Hi

I have the following table relationship

Father -< Child -< GrandChild

Every table has numeric values that I would like to summarize but I have only one query:

select ...
from Father, Child, GrandChild
where Father.id = Child.parentId(+) and
Child.id = GrandChild.parentId(+)

In this query I would like to summarize values from Child and GrandChild. But if I summarize Child values they will be repeated depending on the number of GrandChild he has. So is there a way to do a "SUM" that will only summarize the values in Child without values repeating? SUM DISTINCT will not work because I can have values in two Childs that are equal.

Regards,

Néstor Boscán
This post has been answered by Stew Ashton on Oct 15 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 12 2012
Added on Oct 15 2012
3 comments
307 views