pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kim Petersen <kp@kyborg.dk>
To: pgsql-sql@postgresql.org
Subject: Re: problematic query (for me ;-) [solved? - sorry to bother]
Date: Wed, 05 Mar 2003 15:47:40 +0100
Message-ID: <3E660E0C.2020605@kyborg.dk> (raw)
References: <3E660A41.7040509@kyborg.dk>

Kim Petersen wrote:
> I'm trying to get a hint as to how i can solve this problem:

it seems it works to post to a newsgroup - i've been trying to solve 
this for hours - and just came up with a solution - only question now is 
whether or not it is usable (on millons of tuples).

select distinct t1.n,t2.n from test t1,test t2
    where not exists
      (select t from test where n=t1.n
          intersect
       select t from test where n=t2.n);

optimization ideas would be greatly appreciated.






Message-ID: <3E660E0C.2020605@kyborg.dk>
Permalink:  ../3E660E0C.2020605@kyborg.dk/
Also on:    postgresql.org/message-id/3E660E0C.2020605@kyborg.dk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: kp@kyborg.dk
  Subject: Re: problematic query (for me ;-) [solved? - sorry to bother]
  In-Reply-To: <3E660E0C.2020605@kyborg.dk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox