Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Finding interconnected nodes of a graph using Oracle - SQL

Finding interconnected nodes of a graph using Oracle - SQL

From: babu <babu2244_at_hotmail.com>
Date: 28 Feb 2006 05:26:54 -0800
Message-ID: <1141133214.837960.152520@z34g2000cwc.googlegroups.com>

Customer           Master Account    Local Account 		File
aaaa		10		100		D_10
bbbb		10		200		D_10
cccc		20		100		D_10
dddd		30		100		D_10
eeee		40		20		D_10
ffffff		50		30		D_10
		500		50		D_10

------------------------------------------------------------------------------------------------------------
a1111 300 500 d_300 b1111 500 523 d_300 c0000 523 900 d_300 d0000 900 765 D_300
-------------------------------------------------------------------------------------------------------------

I have a problem to solve. I have a table that lists customer, Master Account and Local Account for the customer. I need to group the related accounts to a file - so that only one salesperson can handle the same. I have to group all the related accounts together. Two accounts are related if they are assigned to same customer somewhere. File name could be anything - but the most important thing is related accounts should be together.

However local account and master account do not have any tree relation ship. Meaning a master can be a local and a local can be a master. So it is not possible for me to use hierarchical query. Moreover I need to group all the related accounts together

In the total data sets of local and master accounts - many connected undirected graphs exists and I need to find them all.

Can you suggest how can I accomplish this using Oracle - SQL. without using recursive procedure. Received on Tue Feb 28 2006 - 07:26:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US