Re: Is it possible to have an outer join with a Group By in the same query ?
Date: Sat, 3 Mar 2001 17:42:31 -0600
Message-ID: <Rifo6.382$na.6935_at_nnrp1.sbc.net>
i don't have your tables, or completely understand the problem you are trying to solve, but this query may return the result set you want
select s.symbol
, q.maxtransdate
from symbols s
, ( select a.symbol , max(a.transdate) as maxtransdate from account a group by a.symbol ) q
where s.symbol=q.symbol(+)
"Alan" <alanshein_at_spambuster.erols.com> wrote in message
news:97loia$kj1$1_at_bob.news.rcn.net...
> The way you are doing it is probably much faster than if you combine them.
>
> "kilidire" <cr389_at_torfree.net> wrote in message
> news:qgur9t4o4l7heg4752206oroufp6em2v2t_at_4ax.com...
> > 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.
>
>
>
Received on Sun Mar 04 2001 - 00:42:31 CET