finding rows in one table not in another

From: Brook Milligan <brook(at)trillium(dot)NMSU(dot)Edu>
To: pgsql-sql(at)postgresql(dot)org
Subject: finding rows in one table not in another
Date: 1998-06-12 20:39:25
Message-ID: 199806122039.OAA29466@trillium.nmsu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Browse pgsql-sql by date

  From Date Subject
Next Message Jackson, DeJuan 1998-06-12 20:57:54 RE: [SQL] finding rows in one table not in another
Previous Message Jose' Soares Da Silva 1998-06-12 17:37:29 Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs