From: | Ulf Mehlig <umehlig(at)uni-bremen(dot)de> |
---|---|
To: | clark(dot)evans(at)manhattanproject(dot)com |
Cc: | mlemos(at)acm(dot)org, pgsql-general(at)postgreSQL(dot)org |
Subject: | Re: [GENERAL] Negating the list of selected rows of a join |
Date: | 1999-03-14 08:17:20 |
Message-ID: | 199903140817.JAA01849@pandora3.uni-bremen.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Clark Evans <clark(dot)evans(at)manhattanproject(dot)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(at)zmt(dot)uni-bremen(dot)de>
Center for Tropical Marine Ecology/ZMT, Bremen, Germany
----------------------------------------------------------------------
From | Date | Subject | |
---|---|---|---|
Next Message | Clark Evans | 1999-03-14 08:21:13 | Re: [GENERAL] Negating the list of selected rows of a join |
Previous Message | Ulf Mehlig | 1999-03-14 08:07:00 | Re: [GENERAL] Negating the list of selected rows of a join |