X-Original-To: pgsql-sql@postgresql.org Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id F408A476082 for ; Wed, 5 Mar 2003 09:49:35 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id B221543A896; Wed, 5 Mar 2003 09:49:34 -0500 (EST) Message-ID: <3E660A41.7040509@kyborg.dk> Date: Wed, 05 Mar 2003 15:31:29 +0100 From: Kim Petersen Organization: Kyborg A/S User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: da, en-us MIME-Version: 1.0 X-Newsgroups: comp.databases.postgresql.sql Subject: problematic query (for me ;-) Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 24 X-Complaints-To: abuse@post.tele.dk To: pgsql-sql@postgresql.org X-Archive-Number: 200303/295 X-Sequence-Number: 12335 I'm trying to get a hint as to how i can solve this problem: i have a table: n | t ---+--- 1 | 2 1 | 5 2 | 3 2 | 5 3 | 4 3 | 3 (6 rows) now i want to find the pairs (n1,n2) where no t's collide - eg in this table it would be (1,3) and (3,1). Note - this is not homework ;-) what i'm actually trying to do is to extract n=(countyid,roadid) t=housenumber - and find out which roads that *cannot* cross county border because their housenumbers collide (to this i've already narrowed the n's depending on roadname).