Re: Tree in SQL

2001-10-24 Thread Dan Nelson
In the last episode (Oct 22), Daniel _a_ said: > I have a table in database which describes tree structure of article groups. > In this table I have: > 1. group_id - group identifier > 2. parent_group_id - identifier of parent group > I need to select history, from top to wanted group. > I can't c

RE: Tree in SQL

2001-10-23 Thread Steve Meyers
I understand that you only have one table. The query I gave you joins the same table against itself, and aliases it to a, b, and c. The only question was whether the depth is always the same. Steve Meyers > Hi > > I have one table and the depth is not always the same. > > Anyway thanks :

ODP: Tree in SQL

2001-10-22 Thread Daniel Las
Thank you. I was trying too long to do this in SQL. > -Oryginalna wiadomoœæ- > Od: Dan Nelson [mailto:[EMAIL PROTECTED]] > Wys³ano: 22 paŸdziernika 2001 23:38 > Do: Daniel _a_ > DW: Lista MySQL > Temat: Re: Tree in SQL > > > In the last episode (Oct 22), Da

ODP: Tree in SQL

2001-10-22 Thread Daniel Łaś
> -Oryginalna wiadomość- > Od: Steve Meyers [mailto:[EMAIL PROTECTED]] > Wysłano: 23 października 2001 07:44 > Do: Daniel Lao; Lista MySQL > Temat: RE: Tree in SQL > > > If the depth of the tree is always the same, it is actually > fairly easy. For instance, if there are three le

RE: Tree in SQL

2001-10-22 Thread Steve Meyers
depth, you'll have to do a recursive search (keep on querying for the next parent until you run out of parents). Steve Meyers > -Original Message- > From: Daniel Łaś [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 22, 2001 3:34 PM > To: Lista MySQL > Subject: Tree in SQL

Tree in SQL

2001-10-22 Thread Daniel Łaś
Hi I have a table in database which describes tree structure of article groups. In this table I have: 1. group_id - group identifier 2. parent_group_id - identifier of parent group I need to select history, from top to wanted group. I can't change the database design and ofcourse this is MySQL 3.