dbTalk Databases Forums  

new ANSI join syntax question

comp.database.oracle comp.database.oracle


Discuss new ANSI join syntax question in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
UNIXNewBie
 
Posts: n/a

Default new ANSI join syntax question - 02-17-2004 , 02:05 PM






I've got this query in the "old" join Oracle syntax.



SELECT

T1.C1,

T2.C1,

T3.C1

FROM

TABLE_1 T1, TABLE_2 T2, TABLE_3 T3

WHERE

T1.C2 = T2.C2

AND

T1.C2 = T2.C2





I want to re-write it in the "new" ANSI syntax. The following does not work.
The problem seems to be in the specification of more than two joined tables.
How do I specify more than two tables to join using the new ANSI syntax? The
column names are not the same so I cannot use the "USING" clause.



SELECT

T1.C1,

T2.C1,

T3.C1

FROM

TABLE_1 T1 INNER JOIN TABLE_2 T2 AND TABLE_1 T1 INNER JOIN TABLE_3
T3

ON

T1.C2 = T2.C2

AND

T1.C2 = T3.C2



Thanks

J.



Reply With Quote
  #2  
Old   
Hilarion
 
Posts: n/a

Default Re: new ANSI join syntax question - 02-17-2004 , 05:41 PM






Quote:
SELECT T1.C1, T2.C1, T3.C1
FROM TABLE_1 T1 INNER JOIN TABLE_2 T2
AND TABLE_1 T1 INNER JOIN TABLE_3 T3
ON T1.C2 = T2.C2
AND T1.C2 = T3.C2
Shouldn't it be something like:

Quote:
SELECT T1.C1, T2.C1, T3.C1
FROM TABLE_1 T1 INNER JOIN TABLE_2 T2 ON T1.C2 = T2.C2
INNER JOIN TABLE_3 T3 ON T1.C2 = T3.C2
Hilarion




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.