Re: [SQL] finding rows in one table not in another

Поиск
Список
Период
Сортировка
От Brook Milligan
Тема Re: [SQL] finding rows in one table not in another
Дата
Msg-id 199806122250.QAA00571@trillium.nmsu.edu
обсуждение исходный текст
Ответ на RE: [SQL] finding rows in one table not in another  ("Jackson, DeJuan" <djackson@cpsgroup.com>)
Список 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);
   >
   try:
       SELECT mytable1.id
    FROM mytable1
       WHERE NOT EXIST (SELECT mytable2.id
              FROM mytable2
             WHERE mytable1.id = mytable2.id);

Thanks.  That works except it should be EXISTS (i.e., plural).

Cheers,
Brook



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

Предыдущее
От: "Tim J Trowbridge"
Дата:
Сообщение: Re: [SQL] DefineQueryRewrite: rule plan string too big
Следующее
От: "Jackson, DeJuan"
Дата:
Сообщение: RE: [SQL] finding rows in one table not in another