Received: from gw.heart.com.au (mail.heart.com.au [203.12.235.237]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f94NmKn06934 for ; Thu, 4 Oct 2001 19:48:22 -0400 (EDT) (envelope-from keith@heart.com.au) Received: from tardis.heart.com.au (IDENT:root@tardis.heart.com.au [192.168.0.42]) by gw.heart.com.au (8.9.3/8.9.3) with ESMTP id JAA25871 for ; Fri, 5 Oct 2001 09:51:34 +1000 Received: from heart.com.au ([192.168.0.87]) by tardis.heart.com.au (8.9.3/8.8.7) with ESMTP id JAA05597 for ; Fri, 5 Oct 2001 09:47:59 +1000 Message-ID: <3BBCF50C.D3BFAF4F@heart.com.au> Date: Fri, 05 Oct 2001 09:47:24 +1000 From: Keith Gray X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: SQL Subject: Alias Join Table Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200110/70 X-Sequence-Number: 5025 If I have the following 'Hierachy' table... Child | Parent -------------- 1 | 0 2 | 1 3 | 1 4 | 3 5 | 4 6 | 3 7 | 4 How do I return a list 5,4,3,1 ? SELECT a.Child FROM Hierachy AS a, Hierachy AS b WHERE a.Parent = b.Child AND a.Child = 5; ... is obviously a bit simplistic in my approach. -- Keith Gray Technical Development Manager Heart Consulting Services P/L mailto:keith@heart.com.au