Re: [GENERAL] Negating the list of selected rows of a join

Поиск
Список
Период
Сортировка
От Ulf Mehlig
Тема Re: [GENERAL] Negating the list of selected rows of a join
Дата
Msg-id 199903140817.JAA01849@pandora3.uni-bremen.de
обсуждение исходный текст
Ответ на Re: [GENERAL] Negating the list of selected rows of a join  (Clark Evans <clark.evans@manhattanproject.com>)
Список pgsql-general
Clark Evans <clark.evans@manhattanproject.com>:

 > Manuel Lemos wrote:
 > > How can I make a query that works the way I want all the time, even for the
 > > case when table_b is empty?
 >
 > SELECT table_a.name, table_a.age
 >   FROM table_a
 >  WHERE NOT EXISTS (
 >           SELECT 'x'
 >             FROM table_b
 >            WHERE table_b.name = table_a.name
 >        );
 >
 > Hope this will do the trick.

Maybe not -- doesn't that mean, that the query won't return a single
row in case there is *any* pair of equal names in both tables?!

Have a nice (sun)day,
Ulf

--
======================================================================
Ulf Mehlig    <umehlig@zmt.uni-bremen.de>
              Center for Tropical Marine Ecology/ZMT, Bremen, Germany
----------------------------------------------------------------------

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

Предыдущее
От: Ulf Mehlig
Дата:
Сообщение: Re: [GENERAL] Negating the list of selected rows of a join
Следующее
От: Clark Evans
Дата:
Сообщение: Re: [GENERAL] Negating the list of selected rows of a join