Re: AAARRRGGG! QUERY HELP!!!!
Posted in 1996
Another possible ???
select a.columnc, a.columnd from a
where not exists ( select * from b where b.columnc = a.columnc
and b.columnd = a.columnd );
I hope some of these columns are indexed ??
Mike.
In article <57vovj$fh5@cssun.mathcs.emory.edu>, Richard Walther
<richardw@orion.dairymans.com> writes
>A possible solution for this is....
> select a.columnc, a.columnd
> from a
> where a.columnc not in (select b.columnc
> from b
> where b.columnc = a.columnc
> and b.columnd = a.columnd)>
> This is probably not the most efficient way of accomplishing your task...
> But it should work...
>
>----------------------------------------------------------------------------
>Richard Walther
>Senior Programmer
>Dairyman's Cooperative Creamery Association
>richardw@orion.dairymans.com
>
>} From informix-list-owner@rmy.emory.edu Wed Nov 27 12:37:34 1996
>} Subject: AAARRRGGG! QUERY HELP!!!!
>} Reply-To: "Blair Maddock" <blair.maddock@attws.com>
>} Organization: AT&T Wireless Services
>} Sender: informix-list-owner@rmy.emory.edu
>} To: informix-list@rmy.emory.edu
>} X-Informix-List-To: richardw@orion.dairymans.com
>} X-Informix-List-Id: <news.30955>
>} Content-Length: 538
>} X-Lines: 20
>}
>} I have two tables that I need to compare. Table A and Table B.
>}
>} Two columns in A and two columns in B share similar values. I want to
>} extract all A entries where the A columns
>} are not in the B table colums.
>} e.g. Table A has a record with 1,3 (columnc,columnd) in the two columns.
>} Table B has 1,2 and 1,4 but no 1,3 as values from those two columns. I
>} tried the following:
>}
>} select A.columnc,Acolumnd
>} where A.columnc Not In
>} (select B.columnc from B)
>} and
>} A.columnd Not In
>} (select B.columnd from B)
>}
>}
>} and It didn't work
>}
>} Help
>}
--
Mik Hobbs