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 -> Puzzle - HELP joining a table recursively++

Puzzle - HELP joining a table recursively++

From: <petehorn_at_my-deja.com>
Date: Fri, 20 Aug 1999 17:58:59 GMT
Message-ID: <7pk50r$4p2$1@nnrp1.deja.com>


Hello all -

I have a SQL puzzle.
I've simplified my situation somewhat but it still retains the same challenge. Perhaps this is simple -- please educate me.

The first table just contains a set ID and name. As an example, I'll use databases.

Table 1 - setname
id name
---- ------------
1 oracle
2 sybase
3 db2
4 ims
5 relational databases
6 databases

Table 2 - setcontents

id member
-- ----------
5 1
5 2
5 3
6 4
6 5

Table 2 contains the relationship among the values in Table 1 so as to form hierarchical sets of information. In other words the set of all databases (id=6) consists of the set of relational databases (id=5) and ims (id=4); and the set of relational databases (id=5) consists of oracle, sybase, and db2.

What's the SQL to expand all the sets recursively?

Thanks.
pete

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Fri Aug 20 1999 - 12:58:59 CDT

Original text of this message

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