Unix Technical Forum

hierarchy information

This is a discussion on hierarchy information within the MySQL forums, part of the Database Server Software category; --> How do I go about representing hierarchy information in a table? Do I use a field to determine it(say ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:01 AM
Jon Slaughter
 
Posts: n/a
Default hierarchy information

How do I go about representing hierarchy information in a table? Do I use a
field to determine it(say a "level" and use the position in the table to
determine it) or is there a better way?


essentially I am going to store "comments" and need to keep the heirarchy in
some way but I'm not sure the "best" way. Seems like a waste to use an extra
field but that might be the easiest.

What I mean is that if I have something like

1
1.1
1.2
1.2.1
1.2.2
1.2.3
1.3
2
2.1
2.1.1
2.1.2
2.2
etc...


so I could just store the "level" in the table.

I won't have any need to remove rows so that might help.

Thanks,
Jon


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:01 AM
Captain Paralytic
 
Posts: n/a
Default Re: hierarchy information

On 14 Jun, 07:52, "Jon Slaughter" <Jon_Slaugh...@Hotmail.com> wrote:
> How do I go about representing hierarchy information in a table? Do I use a
> field to determine it(say a "level" and use the position in the table to
> determine it) or is there a better way?
>
> essentially I am going to store "comments" and need to keep the heirarchy in
> some way but I'm not sure the "best" way. Seems like a waste to use an extra
> field but that might be the easiest.
>
> What I mean is that if I have something like
>
> 1
> 1.1
> 1.2
> 1.2.1
> 1.2.2
> 1.2.3
> 1.3
> 2
> 2.1
> 2.1.1
> 2.1.2
> 2.2
> etc...
>
> so I could just store the "level" in the table.
>
> I won't have any need to remove rows so that might help.
>
> Thanks,
> Jon


Take a look at:
http://dev.mysql.com/tech-resources/...ical-data.html

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 11:02 AM
Jon Slaughter
 
Posts: n/a
Default Re: hierarchy information


"Captain Paralytic" <paul_lautman@yahoo.com> wrote in message
news:1181810513.117378.34290@i38g2000prf.googlegro ups.com...
> On 14 Jun, 07:52, "Jon Slaughter" <Jon_Slaugh...@Hotmail.com> wrote:
>> How do I go about representing hierarchy information in a table? Do I
>> use a
>> field to determine it(say a "level" and use the position in the table to
>> determine it) or is there a better way?
>>
>> essentially I am going to store "comments" and need to keep the heirarchy
>> in
>> some way but I'm not sure the "best" way. Seems like a waste to use an
>> extra
>> field but that might be the easiest.
>>
>> What I mean is that if I have something like
>>
>> 1
>> 1.1
>> 1.2
>> 1.2.1
>> 1.2.2
>> 1.2.3
>> 1.3
>> 2
>> 2.1
>> 2.1.1
>> 2.1.2
>> 2.2
>> etc...
>>
>> so I could just store the "level" in the table.
>>
>> I won't have any need to remove rows so that might help.
>>
>> Thanks,
>> Jon

>
> Take a look at:
> http://dev.mysql.com/tech-resources/...ical-data.html
>


Thanks
Jon


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:39 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com