Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Query Regarding Outer Join
pankaj_wolfhunter_at_yahoo.co.in wrote:
> Greetings,
> I am quite new to sql and still learning.
> I have a query regarding outer joins.
>
> I have three tables say, table1, table2, table3.
>
> I want all the rows (even if they are not matching) in table1 when
> combining with table2
> and table3.
>
> My query looks like this.
>
> SELECT ID,.......................
> FROM TABLE1 TAB1table1 tab1,
> TABLE2 TAB2,
> TABLE3 TAB3
> WHERE TAB1.DT = TAB2.DT(+)
> AND TAB1.SYM = TAB2.SYM(+)
> AND TAB1.ID = TAB2.ID(+)
> AND TAB2.DT = TAB3.DT(+)
> AND TAB2.SYM = TAB3.SYM(+)
> AND TAB2.ID = TAB3.ID(+)
> AND TAB2.REFNO = TAB3.REFNO(+)
> ................................
>
> My main objective is to get all the id's and its respective record from
> table1 (TAB1)
> even when it does not match the conditions. But this is not happening.
>
> I mean we have a source data and we have to compare the output of this
> query with the source data.
> But source and my query's output is not matching.
>
> Is something wrong with my query? Is this the right way?
>
> Any help would be appreciate1.
>
> DB Version info:
> Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
> PL/SQL Release 10.2.0.1.0 - Production
>
> TIA
Join TAB1 and TAB2 and then make that result set an in-line view
but putting it into parentheses. Then outer join that result to
TAB3.
-- Daniel Morgan University of Washington Puget Sound Oracle Users GroupReceived on Thu Sep 28 2006 - 11:44:47 CDT
![]() |
![]() |