Re: Multiple Rollups in an RDBMS

From: Stephen Newhouse <bps2_at_bps2.ebay.sun.com>
Date: 1995/05/19
Message-ID: <3pgrcm$gu9_at_male.EBay.Sun.COM>#1/1


In article DC0_at_gremlin.nrtc.northrop.com, maurit_at_world.nad.northrop.com (Mark W. Aurit) writes:
> We have an application we will be running on an Oracle7 RDBMS that,
> frankly, Im not sure how to address. It calls for a multi-level
> rollup (see below), and Im looking for a good solution. The
> report can be many inches thick, so Im looking for a solution
> on the server. Im wondering if I can do it in an Oracle report
> writer, or perhaps COBOL would be best.
>
> Input:
> Lvl Desc Amt
> 1 Vehicles
> 2 Total Foreign
> 3 Foreign Cars
> 4 Accura 1
> 4 Centura 2
> 3 Foreign Utility
> 4 Samuri 3
> 2 Total American
> 3 American Cars
> 4 Taurus 4
> 4 Escort 5
> 3 American Utility
> 4 Blazer 6
> 4 Cherokee 7
>
> Output:
> Accura 1
> Centura 2
> Total Foreign Cars 3
> Samuri 3
> Total Foreign Utility 3
> Total Foreign 6
> Taurus 4
> Escort 5
> Total American Cars 9
> Blazer 6
> Cherokee 7
> Total American Utility 13
> Total American 22
> Total Vehicles 28
>

I'm sure I'm stating the obvious but just in case.....

With a table of the structure including columns

PARENT_ID
CHILD_ID (where PARENT_ID and CHILD_ID are both ID's against the same master table containing the automobile information to which you refer.

which I assume you have to define your multi-level structure, the CONNECT BY clause of the SELECT statement is made for just such a report.

If there is something more complex you are asking, sorry! Received on Fri May 19 1995 - 00:00:00 CEST

Original text of this message