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
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 :
Thank you. I was trying too long to do this in SQL.
> -Oryginalna wiadomoæ-
> Od: Dan Nelson [mailto:[EMAIL PROTECTED]]
> Wys³ano: 22 padziernika 2001 23:38
> Do: Daniel _a_
> DW: Lista MySQL
> Temat: Re: Tree in SQL
>
>
> In the last episode (Oct 22), Da
> -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
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
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.