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

Home -> Community -> Usenet -> c.d.o.tools -> 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: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 01 Mar 2001 09:34:57 +0100
Message-ID: <h82s9tg88v1adehi311gdqlkbgikvcekgv@4ax.com>

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

Original text of this message

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