Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Avoid a subselect "where not equal to"?

Re: Avoid a subselect "where not equal to"?

From: Ed Prochak <edprochak_at_gmail.com>
Date: 1 Aug 2006 12:21:54 -0700
Message-ID: <1154460114.894996.85220@i3g2000cwc.googlegroups.com>

Martin T. wrote:
> andrew.fabbro_at_gmail.com wrote:
> > (snipped)
> >
> > And that worked fine. However, someone else referred to this as a
> > "nasty" query, opining that "where not in (select...) queries are some
> > of the worst" in a performance sense.
> >
>
> But ... thats exactly what you want to know, isn't it?
> -> "Give me all new ones where no open ones exist."
> So I guess it's OK to ask Oracle exactly that :)
>
> I think this query can scale very well, with the right indexes ...
>
> best,
> Martin

Indices alone won't help. Charles Hooper gave a good solution. An outer join where you pick the rows with NULL works. But it all depends on the version of ORACLE.

 Ed Received on Tue Aug 01 2006 - 14:21:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US