Re: Finding records that are not there

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Owen Hartnett <owen(at)clipboardinc(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Finding records that are not there
Date: 2008-05-22 16:47:33
Message-ID: 20080522164733.GA31210@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 22, 2008 at 12:21:35PM -0400, Owen Hartnett wrote:
> The SQL I've tried is:
> select commcost.maplot, commcost.unitno from commcost
> where not exists(select 1 from commcost, bldg
> where commcost.maplot = bldg.maplot and
> commcost.unitno = bldg.unitno)
> order by commcost.maplot

change it to:

> select commcost.maplot, commcost.unitno from commcost
> where not exists(select 1 from bldg
> where commcost.maplot = bldg.maplot and
> commcost.unitno = bldg.unitno)
> order by commcost.maplot

or simply write:

select * from commcost except select * from bldg;

depesz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Roberts, Jon 2008-05-22 16:50:47 Re: Finding records that are not there
Previous Message Adam Rich 2008-05-22 16:46:52 Re: Finding records that are not there