From: David Goodwin <dof@codepoets.co.uk>
To: pgsql-sql@postgresql.org
Subject: Re: reversion? Recursion question
Date: Thu, 17 Apr 2003 20:08:14 +0100
Message-ID: <20030417190814.GA4905@codepoets.co.uk> (raw)
In-Reply-To: <1050451222.13093.22.camel@aragorn.vpop.net>
References: <OFE1236E52.91368B73-ON88256CFD.007BF75E-88256D09.007D1BBA@fds.com>
<1050451222.13093.22.camel@aragorn.vpop.net>
Brad Hilton wrote :
> On Tue, 2003-04-15 at 15:41, Patrick Hatcher wrote:
> > Hello,
> > For lack of a better title, I need to a reverse recursion. Where I have
> > the parent ID, but then I need to find all it's children, grandchildren,
> > great-grandchildern, etc for the parent-id. I guess this would be like a
> > directory and all its sub-directories.
>
> You may want to look at another way of doing this. Joe Celko gives an
> example of "nested sets" which allows you to select tree-like sets from
> your database very efficiently. His book "SQL for Smarties" has a
> chapter on this, or google for "celko sql tree" and you'll find some
> articles he's written on it. Here's a link to one:
> http://www.intelligententerprise.com/001020/celko.shtml.
Thanks for that! It's going to improve my life no end!
David.
--
David Goodwin
[ dof at codepoets dot co dot uk ]
[ http://www.codepoets.co.uk ]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dof@codepoets.co.uk
Subject: Re: reversion? Recursion question
In-Reply-To: <20030417190814.GA4905@codepoets.co.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox