SQL: flattening a hierarchy
Date: 1995/05/25
Message-ID: <D95FsF.3ID_at_gremlin.nrtc.northrop.com>#1/1
While this is obviously play data, Im doing something like it for
an application, and find it to be a real bitch.
The input file lends itself to the Oracle connect by/start sql extension,
which allows one to walk the file hierarchically. However,
I need to rearraign the file to a seperate physical table to
support listbox's and the like, and a flattened structure will be
much more useful.
The input is:
Thx, Mark
Parent Child Level
------ ----- -----
AllCars 1
AllCars Ford 2
Ford FullSize 3
Ford Sports 3
Sports Mustang 4
Sports Probe 4
Ford Utility 3
FullSize Taurus 4
Ford Vans 3
Vans MiniVan 4
AllCars GM 2
I want to flatten it to something like:
Level1 Level2 Level3
------ -------- -------
Ford FullSize Taurus
Ford Vans MiniVan
Ford Utility Explorer
Ford Sports Mustang
Ford Sports Probe
GM ................
--
Mark Aurit
Finance Client/Server Systems
Northrop Grumman Data Systems (West)
maurit_at_world.nad.northrop.com
Received on Thu May 25 1995 - 00:00:00 CEST