Re: help with nested set
Date: Mon, 13 Apr 2009 11:52:44 -0700 (PDT)
On Apr 13, 10:29 am, paul c <toledobythe..._at_oohay.ac> wrote:
> > id client_id parent_id level
> > 1 1 NULL Corporate
> > 2 NULL 1 Franchise 1
> > 4 NULL 1 Eastern Region
> > 5 NULL 4 New York District
> > ...
> No, assuming you plan to recurse a tree, how will you end the recursion?
Can you show me what you think is going to happen? I've done this before, and it works fine. Recursion ends when you get either to the root node, or when you get to the last terminal node, depending on which direction you are going, up or down.
The column parent_id is related to id, not client_id. It's a selfjoin. See 'The Adjacency List model' in this article: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html Received on Mon Apr 13 2009 - 20:52:44 CEST