From: Dan Nelson Date: October 22 2001 9:37pm Subject: Re: Tree in SQL List-Archive: http://lists.mysql.com/mysql/88860 Message-Id: <20011022163738.A17419@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 change the database design and ofcourse this is MySQL 3.23 database. > Can somebody help me ? You'll have to do multiple selects. Loop: select parent_group_id from table where group_id = :myid :myid = parent_group_id Stop when myid == the ID of the top of the tree. -- Dan Nelson dnelson@stripped