Re: help with nested set

From: lawpoop <lawpoop_at_gmail.com>
Date: Mon, 13 Apr 2009 11:52:44 -0700 (PDT)
Message-ID: <d4e34bc7-f221-4795-aec5-d0963eb2116c_at_r28g2000vbp.googlegroups.com>


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

Original text of this message