Re: help with nested set
Date: Thu, 16 Apr 2009 16:13:02 -0700
Message-ID: <5tleu456bk52rgbqch16lkaqnjiuivgqij_at_4ax.com>
lawpoop <lawpoop_at_gmail.com> wrote:
>On Apr 13, 9:27 am, paul c <toledobythe..._at_oohay.ac> wrote:
>> lawpoop wrote:
>>
>> ...
>>
>> > Suppose I had this adjacency list:
>>
>> > id client_id parent_id level
>> > 1 1 NULL Corporate
>> > 2 1 1 Franchise 1
>> > 4 1 1 Eastern Region
>> > 5 1 4 New York District
>> > ...
>>
>> Can't comment on product techniques but if this were a 'table', I'd
>> wonder how a client can be its own parent. I would have thought some
>> constraint would prevent that.
>
>Are you asking why all of these example rows have a value for the
>client_id? Are you saying it should look like this? :
>
>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
>
>MySQL check constraints are somewhat limited; what would you suggest?
Remove the null.
Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
Received on Fri Apr 17 2009 - 01:13:02 CEST
