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

Home -> Community -> Usenet -> c.d.o.misc -> CONNECT BY / START WITH query to count "families"

CONNECT BY / START WITH query to count "families"

From: <trippknightly_at_hotmail.com>
Date: 27 Sep 2005 13:19:13 -0700
Message-ID: <1127852353.573793.235690@g43g2000cwa.googlegroups.com>


Suppose I have a table that contains Account# & RelatedAccount# (among other things).

How could I use CONNECT BY & START WITH in a query to count relationships or families.

For example, in

ACCT REL_ACCT

Bob     Mary
Bob     Jane

Jane Bob
Larry Moe
Curly Larry

there are 2 relationship sets (Bob,Mary,Jane & Larry,Moe,Curly). If I added

Curly Jane

then there'd be only 1 larger family. Can I use CONNECT BY & START with to detect such relationships and count them? In my case I'd be willing to go any number of levels deep in the recursion. Am open to other suggestions as well.

Thx

Received on Tue Sep 27 2005 - 15:19:13 CDT

Original text of this message

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