From: Martijn Tonies Date: January 12 2004 1:46pm Subject: Re: hierarchical records, I need some help!! ;( List-Archive: http://lists.mysql.com/mysql/157441 Message-Id: <047c01c3d912$7baa4160$0e02a8c0@martijn> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Victor, First: don't ask the same thing twice. > I have one table called noms like this: > > > | id | int(11) | | PRI | [NULL] | auto_increment | > | reference | varchar(255) | > | component | varchar(255) | > > the relation between reference and component is hierarchical like > reference - > component > reference -> component > > I want to have all the items into a recorset with only one query like > > Select id, reference, component from NOMS where reference = '00004' > > but i want not only the primary relations, i want all relations. Second: specify what you mean with "all relations". Can you share some sample data and sample output (that is: what do you expect the query to return). With regards, Martijn Tonies Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL Server. Upscene Productions http://www.upscene.com