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

From: Clark Evans <clark(dot)evans(at)manhattanproject(dot)com>
To: Manuel Lemos <mlemos(at)acm(dot)org>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Negating the list of selected rows of a join
Date: 1999-03-14 07:16:12
Message-ID: 36EB623C.AD192ED3@manhattanproject.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

:) Clark Evans

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Clark Evans 1999-03-14 07:18:13 Re: [GENERAL] PostgreSQL EndTransactionBlock and not inprogress/abort state
Previous Message Manuel Lemos 1999-03-14 03:36:46 Negating the list of selected rows of a join