Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> CONNECT BY / START WITH query to count "families"
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
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