Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Need help with outer join question ?
A variation of this will only produce dates that are in either of the three tables:
select to_char(o.ldate, 'DD-MON-YY') "Date",
p.price "Price", hl.hi_price "Hi Price", hl.lo_price "Lo Price", v.volume "Volume" from price_table p, hilo_table hl, volume_table v, ( select pdate from price_table UNION select pdate from hilo_table UNION select vdate from volume_table ) owhere p.pdate (+) = o.ldate
and hl.pdate (+) = o.ldate
and v.vdate (+) = o.ldate
order by 1
"Michel Cadot" <micadot_at_netcourrier.com> wrote in message
news:9gq75b$867$1_at_s1.read.news.oleane.net...
> "Tom Reid" <thomas_p_reid_at_hotmail.com> a écrit dans le message news:
> 6dfc26f.0106200218.3be5e759_at_posting.google.com...
> > Given the following three tables:-
> >
> > Price_table
> >
> > Price Date Price
> > ---------- -----
> > 16-JUN-01 2.4
> > 18-JUN-01 2.3
> >
> >
> > Hilo_table
> >
> > Price Date Hi_pr Lo_pr
> > ----------- ----- -----
> > 17-JUN-01 2.45 2.35
> > 18-JUN-01 2.35 2.25
> >
> >
> > Volume_table
> >
> > Volume Date Volume
> > ----------- -------
> > 16-JUN-01 10000
> > 17-JUN-01 10101
> >
> > I need a query to produce a 4th table as:-
> >
> > Date Price Hi_pr Lo_pr Volume
> > ---- ------- ----- ----- ------
> > 16-JUN-01 2.4 10000
> > 17-JUN-01 2.45 2.35
> > 18-JUN-01 2.3 2.35 2.45
> >
> >
> > I can't seem to get the query I need, I'm presuming some kind of
> > outer join is required. Any help would be appreciated
>
>
>> 19-JUN-01
> Date Price Hi Price Lo Price Volume
> --------- ---------- ---------- ---------- ----------
> 15-JUN-01
> 16-JUN-01 2.4 10000
> 17-JUN-01 2.45 2.35 10101
> 18-JUN-01 2.3 2.35 2.25
>
>
> > > > > >Received on Wed Jun 20 2001 - 11:41:09 CDT