Re: What is wrong with this query?

From: John Jones <john_at_iluvatar.tip.duke.edu>
Date: 1995/05/16
Message-ID: <Pine.NXT.3.90.950516132612.8634C-100000_at_iluvatar>#1/1


>
> select bill_acct_id
> from transmission, convert_acct
> where bill_acct_id = acct_id(+)
> and convert_acct rowid is null;
>
> This behaves similarly, should work perfectly, and perform a little better in any case.
>
> Michael Stowe
> Constellation Engineering
> http://www.mcs.net/~stowe
>

   Actutally the below works even better, or so I have been told.

select bill_acct_id from transmission where not exists (select 'x' from convert_acct where

            transmission.bill_acct_id = convert_acct.acct_id)

I have used the select not in and the outer joins on very large tables and it would take a very long time to return rows, but when I used the above not exists statement, they would be back in a matter of seconds.


John Jones			| my views are my own.........
Oracle Consultant		| no matter what company they are
john_at_iluvatar.tip.duke.edu	| coming from.
--------------------------------------------------------------------
Received on Tue May 16 1995 - 00:00:00 CEST

Original text of this message