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

Home -> Community -> Usenet -> c.d.o.misc -> Query Regarding Outer Join

Query Regarding Outer Join

From: <pankaj_wolfhunter_at_yahoo.co.in>
Date: 28 Sep 2006 09:42:04 -0700
Message-ID: <1159461724.508880.70080@m7g2000cwm.googlegroups.com>


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 Received on Thu Sep 28 2006 - 11:42:04 CDT

Original text of this message

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