Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Join with more than 2 tables
Message
From
09/01/2001 11:29:02
 
 
To
09/01/2001 10:10:58
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00461136
Message ID:
00461209
Views:
19
Hi Jim.

>2. Is this the nested join? How can it work?
>
>FROM tab1 LEFT OUTER JOIN tab1.c3 = tab2.c3
> RIGHT OUTER JOIN tab3 LEFT OUTER JOIN tab4
> ON tab3.c1
> ON tab2.c3 = tab4.c3

I would do it like this:
from TABLE1 ;
  join TABLE2 ;
    on TABLE1.FIELD1 = TABLE2.FIELD1 ;
  join TABLE3 ;
    on TABLE2.FIELD2 = TABLE3.FIELD2 ;
  join TABLE4 ;
    on TABLE3.FIELD3 = TABLE4.FIELD3
This is much cleaner and easier to read than nested JOIN statements.

Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform