Re: reversion? Recursion question

From: David Goodwin <dof(at)codepoets(dot)co(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: reversion? Recursion question
Date: 2003-04-17 19:08:14
Message-ID: 20030417190814.GA4905@codepoets.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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 ]

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sameer Maggon 2003-04-17 19:27:54 IN Qeury Problem
Previous Message Wei Weng 2003-04-17 18:30:27 Re: IN Qeury Problem