Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL SELECT format
Message
De
31/01/2007 13:06:46
 
 
À
31/01/2007 10:51:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01190908
Message ID:
01191009
Vues:
9
>should the select begin with the parent or the greatgrandchild table, or doesn't it matter? IE
>
>select * from parent ;
>inner join child on ... ;
>inner join grandchild on ... ;
>inner join greatgrandchild on ... ;
>where somecondition
>
>or
>
>select * from greatgrandchild ;
>inner join grandchild on ... ;
>inner join child on ... ;
>inner join parent on ... ;
>where somecondition
>
>Is this a matter of form or is there a significant difference? Is one preferred as a best practice?

If you're doing only inner joins, the order doesn't matter. As Naomi said, the engine will decide the best order to perform the joins.

When outer joins are involved, the order is significant as it may change the results.

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform