Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Join with more than 2 tables
Message
De
09/01/2001 11:29:02
 
 
À
09/01/2001 10:10:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00461136
Message ID:
00461209
Vues:
20
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform