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: Outer Join to a subquery alternative?

Re: Outer Join to a subquery alternative?

From: Ed Prochak <ed.prochak_at_magicinterface.com>
Date: Thu, 05 Feb 2004 07:36:35 -0500
Message-ID: <1pqUb.233$hJ6.115@fe01.usenetserver.com>


John wrote:

> Oracle doesnt like
>
> select whatever
> from maintable m,
> childtable c
> where c.seq(+)=(select max(seq) from childtable c where maintableseq=m.seq)
>
> because it wont allow outer joins to a subquery. If I strip the (+) out,
> then I only get records from maintable which have an entry in childtable -
> I need them even if there isnt an entry in childtable.
>
> Any ideas for a workaround?
>
> Oracle 8.1.7.latest SE.
>
> Thanks!

Your hint is in your question, to do an OUTER JOIN, you need to do a JOIN first. IOW, get rid of the subquery.

If that not enough of a hint, here's a second one. Don't peek unless you really need it.

ready?

look up the phrase "in-line view"

HTH (I really do)

-- 
Ed Prochak
running    http://www.faqs.org/faqs/running-faq/
netiquette http://www.psg.com/emily.html
--
"Two roads diverged in a wood and I
I took the one less travelled by
and that has made all the difference."
robert frost
Received on Thu Feb 05 2004 - 06:36:35 CST

Original text of this message

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