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

Home -> Community -> Usenet -> c.d.o.server -> Re: Is it possible to have an outer join with a Group By in the same query ?

Re: Is it possible to have an outer join with a Group By in the same query ?

From: Gerd Kock <Gerd.Kock_at_BITS-on-the.net>
Date: Wed, 07 Mar 2001 10:40:56 GMT
Message-ID: <3aa60f9b.15057807@news.btx.dtag.de>

Yes it is:
select s.symbol, q.transDate
from symbols s, (select symbol,Max(transDate) transDate

	from account 
	group by symbol) q  

where s.symbol=q.symbol (+);

Gerd Kock

>Is it possible to have an outer join select together with a group by
>in the same query statement ?
>
>Right now, I have to create a temporary table to hold the values from
>one statement and run the 2nd statement like this :
>
>// Load data into the temporary table quick, using a group by
>insert into quick select symbol,Max(transDate) from account group by
>symbol;
>
>// run an outer join select
>select s.symbol, q.transDate from symbols s, quick q where
>s.symbol=q.symbol (+);
>
>I'd be very thankful if someone could show me how to combine these 2
>queries together. Thanks in advance.

Gerd Kock
Baltic IT Service GmbH
Gerd.Kock_at_BITS-on-the.net Received on Wed Mar 07 2001 - 04:40:56 CST

Original text of this message

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