Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Is it possible to have an outer join with a group by in the same query ?
On Thu, 01 Mar 2001 07:14:44 GMT, kilidire <cr389_at_torfree.net> wrote:
>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.
use inline views
select s.symbol, q.transdate
from
(
select symbol,Max(transDate) transdate
from account
group by symbol
) q,
symbols s
where q.symbol(+) = s.symbol
Hth,
Sybrand Bakker, Oracle DBA Received on Thu Mar 01 2001 - 02:34:57 CST