Re: finding records not listed in a column, Postgresql

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: finding records not listed in a column, Postgresql
Дата
Msg-id 20030427153618.GA26384@wolff.to
обсуждение исходный текст
Ответ на finding records not listed in a column, Postgresql  (Aaron Payne <apayneinc@yahoo.com>)
Список pgsql-novice
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;


В списке pgsql-novice по дате отправления:

Предыдущее
От: Paul Makepeace
Дата:
Сообщение: Re: finding records not listed in a column, Postgresql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: finding records not listed in a column, Postgresql