Re: reversion? Recursion question
От | David Goodwin |
---|---|
Тема | Re: reversion? Recursion question |
Дата | |
Msg-id | 20030417190814.GA4905@codepoets.co.uk обсуждение исходный текст |
Ответ на | Re: reversion? Recursion question (Brad Hilton <bhilton@vpop.net>) |
Список | 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 ]
В списке pgsql-sql по дате отправления: