From: Brook Milligan <brook@trillium.NMSU.Edu>
To: pgsql-sql@postgresql.org
Subject: finding rows in one table not in another
Date: Fri, 12 Jun 1998 14:39:25 -0600 (MDT)
Message-ID: <199806122039.OAA29466@trillium.nmsu.edu> (raw)
I need to find the set of rows in one table that are not in another
table. I used a query like the following:
select distinct id from mytable1 where id not in (select distinct id from mytable2);
However, this revealed no rows, even though I know of instances where
id from mytable1 is absent from id in mytable2. Is there some other
way to do this? Am I missing something? Is there a workaround?
Cheers,
Brook
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: brook@trillium.NMSU.Edu
Subject: Re: finding rows in one table not in another
In-Reply-To: <199806122039.OAA29466@trillium.nmsu.edu>
References: <199806122039.OAA29466@trillium.nmsu.edu>
* 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