recursing down a tree

From: Carl Meyer <mrbz(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: recursing down a tree
Date: 2002-06-28 06:29:16
Message-ID: jb0ohu86ct8g27ovvlvsn4rvous07am9fc@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi,

say i have a table with something like

id,parent,description

and parent points to an id of the very same table. now i have
a specific id and i want to recurse down the tree to the root.
is it in any way possible to do that without to doing a sql query
for each level ? until today i always saved the parent and formulated
a new query using it to get the next upper level. however, it seems to
me that this might be quite some work given a tree of a larger size.

thanks for your ideas
carl

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tomisaw Kityski 2002-06-28 07:07:41 Re: Wildcards in GROUP BY?
Previous Message Graeme Merrall 2002-06-28 04:34:23 Re: transfer data from oracle to postgres