On Sun, Apr 27, 2003 at 08:02:16 -0700,
Aaron Payne <apayneinc@yahoo.com> wrote:
> Hi,
>
> I need the records in table A in which the values in
> A.objectID are not listed in B.objectID. I'm such a
> noob that I'm not sure of the terms I need to use for
> this statement.
>
> table A
> rows: person_id, objectID
>
> table B
> rows: id, objectID
Below are two ways of doing this. If A.objectID and B.objectID can both
be NULL, the records in A with NULL values won't be excluded.
select * from A
where not exists (select 1 from B where A.objectID = B.objectID);
select A.person_id, A.objectID from A right join B using (objectID)
where B.objectID is null;