Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 89E9B47599B for ; Sat, 4 May 2002 13:34:08 -0400 (EDT) Received: from ss1000.ms.mff.cuni.cz (ss1000.ms.mff.cuni.cz [195.113.19.221]) by postgresql.org (Postfix) with ESMTP id 930D6475924 for ; Sat, 4 May 2002 13:34:06 -0400 (EDT) Received: from u-pl2.ms.mff.cuni.cz (u-pl2.ms.mff.cuni.cz [195.113.21.162]) by ss1000.ms.mff.cuni.cz (Postfix) with ESMTP id 712011CFB1; Sat, 4 May 2002 19:34:05 +0200 (CEST) Received: by u-pl2.ms.mff.cuni.cz (Postfix, from userid 18664) id CEF70CD02; Sat, 4 May 2002 19:34:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by u-pl2.ms.mff.cuni.cz (Postfix) with ESMTP id CB7B5CCD5; Sat, 4 May 2002 19:34:03 +0200 (CEST) Date: Sat, 4 May 2002 19:34:03 +0200 (CEST) From: Jakub Ouhrabka X-X-Sender: To: Ian Barwick Cc: Subject: Re: difficult query In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200205/24 X-Sequence-Number: 7660 > > Is it possible to do this in sql? > > Basically, no. (You might be able to do it with the help > of a user-defined function though). > > Why do you want to do this? I'm curious. I've been on a sql course long time ago where the tutor mentioned similiar problem as something special for sql smarties... And yesterday when I faced this problem (which can be solved perfectly with the outer join) I wasn't able to remember the solution... If there is any... Just out of curiosity... thanks, kuba