Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id EBFDD47741B for ; Tue, 28 Jan 2003 12:23:25 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 0B405477052 for ; Tue, 28 Jan 2003 11:45:42 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id BB65343AFCF; Tue, 28 Jan 2003 11:45:41 -0500 (EST) From: DA Morgan X-Newsgroups: comp.databases.theory, comp.databases.rdb, comp.databases.postgresql.sql, comp.databases.oracle.misc Subject: Re: double linked list Date: Tue, 28 Jan 2003 08:45:21 -0800 Organization: EXE Message-ID: <3E36B3A1.43E424F3@exesolutions.com> X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 References: <2ee07259.0301280744.582e4b7c@posting.google.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cache-Post-Path: yasure!unknown@mud10.drizzle.com X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) X-Complaints-To: abuse@supernews.com Lines: 46 To: pgsql-sql@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/465 X-Sequence-Number: 11330 Juergen wrote: > Hi folks!, > > I've got a table called 'link_t' containing a collection of seller - > buyer relations between two parties. > > sql> select * from link_t > > S B > - - > C X > A B > B C > C D > D E > > 5 rows selected. > > I am looking for a select statement that returns the concatenation of > seller - buyer relations between the first seller 'A' and the last > buyer 'B'. > > the result should be > > S B > - - > A B > B C > C D > D E > > Currently I fumbling around with self joins but haven't figured out > yet. > Any suggestions > > Many tanks in advance > > Cheers > > Juergen Look at the CONNECT BY built-in function. Daniel Morgan