Home » SQL & PL/SQL » SQL & PL/SQL » Hierarchy remove
Hierarchy remove [message #2673] Tue, 06 August 2002 01:21 Go to next message
Bryan Avery
Messages: 4
Registered: July 2002
Junior Member
I have a table which has a hierarchy structure ,like this

Child Parent
1 0
2 0
3 2
4 2
5 3
6 3
7 3
8 4
9 5
10 1

Another table which has a link to the hierarchy table

Product Child

Sweet 8
Boot 8
Sock 7
Car 10

So it looks something like this

1-
10-
Car
2-
3-
5-
9
6
7-
Sock
4-
8-
Sweet
Boot

Quite simple.

Now the problem, as you can see the tree from 1-10 has a car, 2-3-7 has Sock and 2-4-8 has Sweet and Boot.

But 2-3-5-9 and 2-3-6 have no products.

What I need to be able to do is remove the items so that every tree has a product. What you should be left with is:

1-
10-
Car
2-
3-
7-
Sock
4-
8-
Sweet
Boot

So removing 5, 6 and 9 from the structure, but still keeping 2 and 3.

This is driving me mad and got me going in circles.
Re: Hierarchy remove [message #2690 is a reply to message #2673] Tue, 06 August 2002 14:07 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
http://www.orafaq.net/msgboard/plsql/messages/9851.htm
Previous Topic: Hierarchy remove
Next Topic: Who I can Create Hash Join
Goto Forum:
  


Current Time: Wed Apr 17 22:23:49 CDT 2024