From: | "Dann Corbit" <DCorbit(at)connx(dot)com> |
---|---|
To: | <bedouglas(at)earthlink(dot)net>, "PgSQL-General" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: logic/db question |
Date: | 2006-08-02 21:02:15 |
Message-ID: | D425483C2C5C9F49B5B7A41F8944154757DAE3@postal.corporate.connx.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Typically, a temp table is used for this.
Beware of circular references.
Fred -> Wilma -> Betty -> Barney -> Fred
> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-
> owner(at)postgresql(dot)org] On Behalf Of bruce
> Sent: Wednesday, August 02, 2006 11:55 AM
> To: 'PgSQL-General'
> Subject: [GENERAL] logic/db question
>
> hi...
>
> i have a tbl
> fooTBL
> name
> parentID
> ID
>
> so a name can have might have a parentID, as well as an ID. 'name's
are
> associated with other 'name's via the parentID. in other words, if a
> name's
> parentID == a name's ID, name1 is the parent of name2.
>
> name parentID ID
> foo - 1
> cat 1 2
> dog 2 3
>
> my question, how can i come up with a sql query that will list all the
> children (and children's children...) of a top level item?
>
> i had done this awhile ago.. but can't recall how i did it..
>
> thanks
>
>
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 6: explain analyze is your friend
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas F. O'Connell | 2006-08-02 21:04:35 | Re: Tape backup, 2 versions, same database name, which is pg_dump backing up |
Previous Message | MargaretGillon | 2006-08-02 20:47:27 | Tape backup, 2 versions, same database name, which is pg_dump backing up |