dbTalk Databases Forums  

left outer join syntax for several nested tables.

comp.databases comp.databases


Discuss left outer join syntax for several nested tables. in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mr. X.
 
Posts: n/a

Default left outer join syntax for several nested tables. - 07-06-2010 , 05:45 PM






Hello.
What is the correct syntax for several nested tables for left outer join ?

....
select t1.col1, t2.col2, t3.col3
from tab1 t1
left outer join (tab2 t2
.... what should I put here .
left outer join (tab 3 t3) on (t3.col1 = t2.col1)
) on (t1.col1 = t2.col2)

Thanks

Reply With Quote
  #2  
Old   
Mr. X.
 
Posts: n/a

Default Re: left outer join syntax for several nested tables. - 07-07-2010 , 12:35 AM






.... Especially for mySql.

Reply With Quote
  #3  
Old   
Lennart Jonsson
 
Posts: n/a

Default Re: left outer join syntax for several nested tables. - 07-07-2010 , 03:07 AM



On 2010-07-06 23:45, Mr. X. wrote:
Quote:
Hello.
What is the correct syntax for several nested tables for left outer join ?

...
select t1.col1, t2.col2, t3.col3
from tab1 t1
left outer join (tab2 t2
... what should I put here .
left outer join (tab 3 t3) on (t3.col1 = t2.col1)
) on (t1.col1 = t2.col2)

Thanks
select t1.col1, t2.col2, t3.col3
from tab t1
left join tab t2
on t1.col1 = t2.col2
left join tab t3
on t2.col1 = t3.col2

Some comments, you don't have to use the word outer in "outer left
join", left join will do. You can skip the parentheses in the on clause

/Lennart

Reply With Quote
  #4  
Old   
Mr. X.
 
Posts: n/a

Default Re: left outer join syntax for several nested tables. - 07-08-2010 , 04:32 AM



Thank you.

"Lennart Jonsson" <erik.lennart.jonsson (AT) gmail (DOT) com> wrote

Quote:
On 2010-07-06 23:45, Mr. X. wrote:
Hello.
What is the correct syntax for several nested tables for left outer join
?

...
select t1.col1, t2.col2, t3.col3
from tab1 t1
left outer join (tab2 t2
... what should I put here .
left outer join (tab 3 t3) on (t3.col1 = t2.col1)
) on (t1.col1 = t2.col2)

Thanks

select t1.col1, t2.col2, t3.col3
from tab t1
left join tab t2
on t1.col1 = t2.col2
left join tab t3
on t2.col1 = t3.col2

Some comments, you don't have to use the word outer in "outer left
join", left join will do. You can skip the parentheses in the on clause

/Lennart



Reply With Quote
  #5  
Old   
--CELKO--
 
Posts: n/a

Default Re: left outer join syntax for several nested tables. - 07-10-2010 , 03:29 AM



Quote:
What is the correct syntax for several nested tables for LET OUTER JOIN?
ALL infixed join operators are of equal precedence and are executed
left to right, with the usual rules for parentheses. The ON clause
associates with the nearest JOIN of any kind.

So, what did you want to do EXACTLY?

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.